123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- [Setup]
- AppName=My Program
- AppVersion=1.5
- WizardStyle=modern
- DefaultDirName={autopf}\My Program
- DefaultGroupName=My Program
- UninstallDisplayIcon={app}\MyProg.exe
- Compression=lzma2
- SolidCompression=yes
- OutputDir=userdocs:Inno Setup Examples Output
- DisableWelcomePage=no
- LicenseFile=license.txt
- #define Password 'password'
- Password={#Password}
- InfoBeforeFile=readme.txt
- UserInfoPage=yes
- PrivilegesRequired=lowest
- DisableDirPage=no
- DisableProgramGroupPage=no
- InfoAfterFile=readme.txt
- [Files]
- Source: "MyProg.exe"
- Source: "MyProg.chm"
- Source: "Readme.txt"
- [Icons]
- Name: "{group}\My Program"
- [Components]
- Name: "component"
- [Tasks]
- Name: "task"
- [Code]
- var
- OutputProgressWizardPage: TOutputProgressWizardPage
- OutputProgressWizardPageAfterID: Integer
- procedure InitializeWizard
- var
- InputQueryWizardPage: TInputQueryWizardPage
- InputOptionWizardPage: TInputOptionWizardPage
- InputDirWizardPage: TInputDirWizardPage
- InputFileWizardPage: TInputFileWizardPage
- OutputMsgWizardPage: TOutputMsgWizardPage
- OutputMsgMemoWizardPage: TOutputMsgMemoWizardPage
- AfterID: Integer
- begin
- WizardForm.PasswordEdit.Text := '{#Password}'
- AfterID := wpSelectTasks
-
- AfterID := CreateCustomPage(AfterID, 'CreateCustomPage', 'ADescription').ID
-
- InputQueryWizardPage := CreateInputQueryPage(AfterID, 'CreateInputQueryPage', 'ADescription', 'ASubCaption')
- InputQueryWizardPage.Add('&APrompt:', False)
- AfterID := InputQueryWizardPage.ID
-
- InputOptionWizardPage := CreateInputOptionPage(AfterID, 'CreateInputOptionPage', 'ADescription', 'ASubCaption', False, False)
- InputOptionWizardPage.Add('&AOption')
- AfterID := InputOptionWizardPage.ID
- InputDirWizardPage := CreateInputDirPage(AfterID, 'CreateInputDirPage', 'ADescription', 'ASubCaption', False, 'ANewFolderName')
- InputDirWizardPage.Add('&APrompt:')
- InputDirWizardPage.Values[0] := 'C:\'
- AfterID := InputDirWizardPage.ID
- InputFileWizardPage := CreateInputFilePage(AfterID, 'CreateInputFilePage', 'ADescription', 'ASubCaption')
- InputFileWizardPage.Add('&APrompt:', 'Executable files|*.exe|All files|*.*', '.exe')
- AfterID := InputFileWizardPage.ID
- OutputMsgWizardPage := CreateOutputMsgPage(AfterID, 'CreateOutputMsgPage', 'ADescription', 'AMsg')
- AfterID := OutputMsgWizardPage.ID
- OutputMsgMemoWizardPage := CreateOutputMsgMemoPage(AfterID, 'CreateOutputMsgMemoPage', 'ADescription', 'ASubCaption', 'AMsg')
- AfterID := OutputMsgMemoWizardPage.ID
- OutputProgressWizardPage := CreateOutputProgressPage('CreateOutputProgressPage', 'ADescription')
- OutputProgressWizardPageAfterID := AfterID
- end
- function NextButtonClick(CurPageID: Integer): Boolean
- var
- Position, Max: Integer
- begin
- if CurPageID = OutputProgressWizardPageAfterID then begin
- try
- Max := 25
- for Position := 0 to Max do begin
- OutputProgressWizardPage.SetProgress(Position, Max)
- if Position = 0 then
- OutputProgressWizardPage.Show
- Sleep(2000 div Max)
- end
- finally
- OutputProgressWizardPage.Hide
- end
- end
- Result := True
- end
- function PrepareToInstall(var NeedsRestart: Boolean): String
- begin
- if SuppressibleMsgBox('Do you want to stop Setup at the Preparing To Install wizard page?', mbConfirmation, MB_YESNO, IDNO) = IDYES then
- Result := 'Stopped by user'
- end
|