#define MyAppName "MyProgPlay"
#define MyAppVerName "MyProgPlay"
#define MyAppExeName "MyProg.exe"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
;Source: MyProg.exe; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon
[Run]
Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
[Code]
var
InstallLocation: String;
errCode: Integer;
procedure NextButtonOnClick(Sender: TObject);
begin
ShellExec('open', ExpandConstant('{reg:HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1,InstallLocation|}') + '\{#MyAppExeName}', '', '', sw_Show, ewWaitUntilTerminated, errCode);
end;
procedure CancelButtonClick(CurPage: Integer; var Cancel, Confirm: Boolean);
begin
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1','InstallLocation', InstallLocation) then
begin
Cancel:=False;
Confirm:=False;
if MsgBox('Вы точно уверены, что не хотите запускать эту игру?', mbError, MB_YESNO) = idYes
then
Cancel:=true;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1','InstallLocation', InstallLocation) and (CurPageId=wpWelcome) then
begin
WizardForm.WelcomeLabel1.Caption:='Хотите сыграть в Need for speed 3 Vista edition прямо сейчас?';
WizardForm.WelcomeLabel2.Caption:='Когда Вы будете готовы начать игру, пожалуйста, нажмите кнопку «Играть».
WizardForm.NextButton.Caption:='Играть';
WizardForm.CancelButton.Caption:='Выйти';
WizardForm.NextButton.OnClick:= @NextButtonOnClick;
end;
end;