Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #29 from ethanwhite/no-checkbox
Browse files Browse the repository at this point in the history
Prevent checkbox that runs main install script from being unchecked
  • Loading branch information
ethanwhite committed Jun 15, 2015
2 parents fccc606 + 1cfdff5 commit f6e5718
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion swc-installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,19 @@ Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createal
Name: "{group}\Software Carpentry Windows Installer"; Filename: "{app}\swc-windows-installer.exe"

[Run]
Filename: "{app}\swc-windows-installer.exe"; Description: "{cm:LaunchProgram,Software Carpentry Windows Installer}"; Flags: nowait postinstall skipifsilent
// postinstall flag is needed for installation script to run properly
Filename: "{app}\swc-windows-installer.exe"; Description: "Finish Installation"; Flags: nowait postinstall skipifsilent

[Code]
// Prevent the checkbox generated by postinstall from being unchecked
// From http://stackoverflow.com/questions/18938788/inno-setup-run-program-without-showing-a-checkbox
procedure CurPageChanged(CurPageID: Integer);
begin
// you must do this as late as possible, because the RunList is being modified
// after installation; so this will check if there's at least one item in the
// RunList and then set to the first item (indexing starts at 0) Enabled state
// to False
if (CurPageID = wpFinished) and (WizardForm.RunList.Items.Count > 0) then
WizardForm.RunList.ItemEnabled[0] := False;
end;

0 comments on commit f6e5718

Please # to comment.