You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to innosetup
The sample code below is supposed to ask for a file location in wizard page GetSettingsPage of type TInputFileWizardPage and then save that file in the [Files] section.
I thought using Flags: external would allow me to use a scripted constant to achieve this. But it appears that GetInputFileLocation gets called before InitializeWizard, because I get an error "Line 15: Could not call proc" and GetSettingsPage is nil.
function GetInputFileLocation(Param: String): String; begin Result := GetSettingsPage.Values[0]; end;
procedure InitializeWizard; begin GetSettingsPage := CreateInputFilePage(wpSelectDir, 'Title', 'Msg', 'Submsg'); // Add one input field GetSettingsPage.Add('Label', 'All files (*.*)|*.*', '*.*'); end;
Jorge Moraleda
unread,
May 1, 2024, 9:52:40 PMMay 1
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to innosetup
Answering my own question:
I had to test for "nil" in "GetInputFileLocation":
if GetSettingsPage <> nil then Result := GetSettingsPage.Values[0];
When the function is called "for real" in the phase of writing the files "GetSettingsPage" exists and the function returns the correct value. And when it gets called in the earlier phases, it does not matter what it returns.
Gavin Lambert
unread,
May 2, 2024, 1:45:18 AMMay 2
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to innosetup
On Thursday, May 2, 2024 at 1:52:40 PM UTC+12 Jorge Moraleda wrote:
When the function is called "for real" in the phase of writing the files "GetSettingsPage" exists and the function returns the correct value. And when it gets called in the earlier phases, it does not matter what it returns.
You can disable the call on startup by specifying an ExternalSize (e.g. ExternalSize: 0; or use a more realistic value if you know it to improve the Components page). It may still end up being called more than once later in the installation process, however.
Jorge Moraleda
unread,
May 4, 2024, 10:31:43 AMMay 4
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message