pascalscript

Restore previously entered data on custom page next time Inno Setup-made installer is executed

丶灬走出姿态 提交于 2020-01-11 04:09:12
问题 I want to use this code, but the part of the code to uninstall I need: in the next time I open the executable it can read the information written in this field 'Service name'. Can help me? And even now where it stores this information written in the 'Service name'? Relaced to: How do I record user input during install, so it can be used during uninstall? 回答1: If I understand you correctly, you're looking for a way to fill an input field with the previously stored data. In the example that you

Run a [Code] or PowerShell script in Inno Setup compiler

回眸只為那壹抹淺笑 提交于 2020-01-09 05:33:22
问题 Is there a way to run a [Code] procedure or PowerShell script in the Inno Setup compiler before the installation executable is generated? 回答1: You may get better answers, if you explain what you need to run the code for. Anyway... One way is to compile the script on command-line from a batch file: powershell -file precompile.ps1 ISCC.exe setup.iss powershell -file postcompile.ps1 (or you can call ISCC.exe from the PowerShell script itself) Another way to run some script before compilation is

Inno Setup Disable Next button using multiple validation expressions (when input value matches one of multiple values)

风流意气都作罢 提交于 2020-01-03 03:31:05
问题 I have this code working ... procedure ValidatePage; begin WizardForm.NextButton.Enabled := (CompareText(InputPage6.Values[EditIndex2], 'Admin') <> 0); end; procedure EditChange(Sender: TObject); begin ValidatePage; end; procedure PageActivate(Sender: TWizardPage); begin ValidatePage; end; But I want to add more validations. Example: If you have not allowed EX12345 or EX54321 . WizardForm.NextButton.Enabled := (CompareText(InputPage6.Values[EditIndex2], 'EX12345') <> 0); and WizardForm

Basic email validation within Inno Setup script

試著忘記壹切 提交于 2020-01-02 18:26:00
问题 I'm wanting to do a basic string validation within an Inno Setup script to be relatively certain the string is an email address. I just want to see that there is a '@' character followed by a '.' character and that there is at least one character on either side of these. Something similar to this regular expression: [^@]+@.+\.[^\.] The lack of regular expressions and limited string functions available in object pascal are causing me grief. It would be simple enough to reverse the string, find

Check parameter function in UninstallRun does not work correctly

雨燕双飞 提交于 2020-01-02 14:07:53
问题 I would like to get parameter from [Code] section in [UninstallRun] section. I got "not found" in Debug Output when installing . I didn't call CheckGetFile() when installing...and it didn't call GetFilePath() and CheckGetFile() when Uninstalling..WHY? Here is my script [Code] Var Check: Boolean; function GetFilePath(Default: String): String; begin log('GetFilePath()'); Check := false; Result := ''; { do something } if (Found) then begin Check := true; Result := TargetPath; end; end; function

Can you define a function prototype in Inno Setup

大城市里の小女人 提交于 2020-01-02 08:11:55
问题 I would like to be able to structure my code for my Inno Setup project but I am forced to move code around because you can't call a function unless it is defined first. Is there a way to declare a prototype at the top so that I don't get the "Unknown identifier" error and so that I can structure my code in logical blocks. 回答1: In Pascal (including a Pascal Script used in Inno Setup), you can define a function prototype (aka forward declaration) using a forward keyword: procedure ProcA(ParamA:

Query available RAM in Inno Setup

南楼画角 提交于 2020-01-01 19:31:16
问题 I need to get the available RAM to determinate some characteristics to my software. I have this code to show my PC's RAM: type DWORDLONG = Int64; TMemoryStatusEx = record dwLength: DWORD; dwMemoryLoad: DWORD; ullTotalPhys: DWORDLONG; ullAvailPhys: DWORDLONG; ullTotalPageFile: DWORDLONG; ullAvailPageFile: DWORDLONG; ullTotalVirtual: DWORDLONG; ullAvailVirtual: DWORDLONG; ullAvailExtendedVirtual: DWORDLONG; end; function GlobalMemoryStatusEx(var lpBuffer: TMemoryStatusEx): BOOL; external

Prevent duplicate items in list box and combo box in Inno Setup?

笑着哭i 提交于 2020-01-01 19:24:27
问题 I receive an XML file from internet (values ​from XML ​may vary, cause there are currencies). And then I load it to a list box 1. A user can add items to to list box 2 with some buttons (one by one, all, delete etc). So I want to prevent duplicates. I can't find any way to do this. My list boxes: Here is my code (for XML parsing part, see How to read multiple XML nodes? (Inno Setup)): XMLNodeList := XMLDocument.SelectNodes('//listaPaises/item'); for Index := 0 to XMLNodeList.length - 1 do

Inno Setup: How to watch variables values or write to debug output?

孤人 提交于 2020-01-01 01:29:56
问题 How can I watch values of variables while debugging in Inno Setup? How can I print something to debug output? Thanks 回答1: There's currently no debug watch window, but you can simply hover the variable you want to inspect, when the debugger is stopped on a breakpoint. To print something to a debug output, use the Log procedure: procedure InitializeWizard; var Value: Integer; begin Value := 123; Log('The Value is: ' + IntToStr(Value)); end; Here is the result of the hovered Value variable from

Inno Setup CreateOleObject('IISNamespace') throws exception on Windows Server 2012

怎甘沉沦 提交于 2019-12-30 10:38:13
问题 I am trying to create IISSetup in the Windows Server 2012 (IIS version 8.5) through the below install script but throws error "Invalid class string". code: var IIS, WebSite, WebServer, WebRoot, VDir: Variant; ErrorCode: Integer; begin { Create the main IIS COM Automation object } try IIS := CreateOleObject('IISNamespace'); except RaiseException( 'Please install Microsoft IIS first.'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)'); end; end; 回答1: I had the same issue on a Windows