Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to make a <a href="http://jrsoftware.org/ishelp/topic_scriptcheck.htm#Check"><code>Check</code></a> function which will return state of the check box from the <a href="http://jrsoftware.org/ishelp/topic_scriptcreating.htm"><code>[Code]</code></a> section of your script. Something like this might do what you want, but before the code script I would correct you in the following:</p> <ul> <li>use <strong><em>TNew...</em></strong> classes where you're able to, so in your case use <a href="http://jrsoftware.org/ishelp/topic_scriptclasses.htm#TNewEdit"><code>TNewEdit</code></a> instead of <a href="http://jrsoftware.org/ishelp/topic_scriptclasses.htm#TEdit"><code>TEdit</code></a></li> <li>use <a href="http://jrsoftware.org/ishelp/topic_scriptclasses.htm#TWizardPage"><code>TWizardPage.Surface</code></a> as a <code>Parent</code> if you want to have a certain component on the page (here I'm not sure if that's your intention, just pointing this out :-)</li> <li>format your code, it doesn't need to be so flat</li> </ul> <p></p> <p>In the following example I've used <a href="http://jrsoftware.org/ishelp/topic_scriptcheck.htm#Check"><code>Check</code></a> function called <code>InstallHelpFile</code> for conditional install of a certain file, in this case <code>MyProg.chm</code>. The <a href="http://jrsoftware.org/ishelp/topic_scriptcheck.htm#Check"><code>Check</code></a> function works simply; when you return True to the function, the file is processed, skipped is when you return False.</p> <pre><code>[Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program OutputDir=userdocs:Inno Setup Examples Output [Files] Source: "MyProg.exe"; DestDir: "{app}" Source: "MyProg.chm"; DestDir: "{app}"; Check: InstallHelpFile; [Code] var InstallHelpCheckBox: TNewCheckBox; procedure InitializeWizard; var LabelFolder: TLabel; MainPage: TWizardPage; FolderToInstall: TNewEdit; begin MainPage := CreateCustomPage(wpWelcome, '', ''); LabelFolder := TLabel.Create(MainPage); LabelFolder.Parent := WizardForm; LabelFolder.Top := 164; LabelFolder.Left := 6; LabelFolder.Caption := 'Directory:' FolderToInstall := TNewEdit.Create(MainPage); FolderToInstall.Parent := MainPage.Surface; FolderToInstall.Top := 182; FolderToInstall.Left := 85; FolderToInstall.Width := 380; FolderToInstall.Text := WizardDirValue; FolderToInstall.ReadOnly := True; InstallHelpCheckBox := TNewCheckBox.Create(MainPage); InstallHelpCheckBox.Parent := MainPage.Surface; InstallHelpCheckBox.Top := FolderToInstall.Top + FolderToInstall.Height + 8; InstallHelpCheckBox.Left := FolderToInstall.Left; InstallHelpCheckBox.Width := FolderToInstall.Width; InstallHelpCheckBox.Caption := 'Install help file'; end; function InstallHelpFile: Boolean; begin // here is the Check function used above; if you return True to this // function, the file will be installed, when False, the file won't // be installed Result := InstallHelpCheckBox.Checked; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload