Код:
![Выделить весь код](images/misc/selectcode.png)
#define MyAppName "WinDjView 1.0.3"
#define MyAppVersion "1.0.3"
#define MyAppExeName "WinDjView.exe"
[Setup]
AppId={{60F3D1CB-B2A7-46E7-92B0-93526131061D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName=WinDjView 1.0.3
DefaultDirName={pf}\WinDjView
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
InfoBeforeFile=C:\Users\Admin\Desktop\ss.rtf
OutputDir=D:\Инстляторы
OutputBaseFilename=WinDjView.v1.0.3
SetupIconFile=C:\Users\Admin\Desktop\win.ico
Compression=lzma
SolidCompression=yes
WizardImageFile=картинка.bmp
WizardSmallImageFile=55x55.bmp
UninstallFilesDir={app}\uninstall
DirExistsWarning=no
WizardImageStretch=no
WizardImageBackColor=clWhite
ShowComponentSizes=no
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce; Components: norm;
[Components]
Name: norm; Description: Установка; Flags: exclusive
Name: port; Description: Распаковка; Flags: exclusive
[Files]
Source: "C:\users\Admin\Desktop\WinDjViewPortable\*"; DestDir: {app}\; Flags: ignoreversion createallsubdirs recursesubdirs sortfilesbyextension sortfilesbyname uninsneveruninstall; Components: port Source: "C:\Program Files\WinDjView\*"; DestDir: {app}\; Flags: ignoreversion createallsubdirs recursesubdirs sortfilesbyextension sortfilesbyname; Components: norm
[UninstallDelete]
Type: files; Name: {app}\ ; Components: port
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[ Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
begin
if (CurStep = ssDone) and (IsComponentSelected('port')) then Exec(ExpandConstant('{app}\uninstall\unins000.exe'), '/VERYSILENT', '', SW_SHOW, ewNoWait, ResultCode);
end;
[Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
после распаковки портативной версии программы.