pascalscript

Inno Setup - How to localize a string in Pascal Script?

落花浮王杯 提交于 2019-11-27 06:30:02
问题 How to change the 'Next' with a language? It is possible? procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = iscustompage1.id then starttimer(WizardForm.Handle,WizardForm.NEXTBUTTON.Handle,'Next',5) else if (CurPageID = wpWelcome) or (CurPageID = wpSelectDir) then begin stoptimer(); end; end; 回答1: To localize a string for Pascal Script, define a custom message in the language file: [CustomMessages] NextButtonCaption=Next And then use this custom message using the CustomMessage

Required a number in text box in Inno Setup

蓝咒 提交于 2019-11-27 06:19:54
问题 I found a code here that I needed. To only allow write numbers in a text box. But I still wanted more, which does not offer up the "Next" button without write the number in this text box. Can help me? procedure NumbersOnly(Sender: TObject; var Key: Char); var S: string; begin S := ('1234567890'#8); if Pos(Key, S) = 0 then Key := #0; end; 回答1: You can setup the next button to be enabled or disabled in the CurPageChanged event when the user reaches the page where resides your edit box. Except

Access file list via script in InnoSetup

那年仲夏 提交于 2019-11-27 05:30:58
Is there any way to access the list of files (entries in the [Files] section) from PascalScript when running the setup? We're trying to make the application runnable directly from the setup, rather than having to install it, and this would make it easier to maintain the file list. The idea here is to store the file names into the separate text file (the Source.txt here) where each line will be one file. The preprocessor will then generate the script for you. Actually it creates the array which contains the list of the files from the Source.txt and add all of its elements into the [Files]

Inno Setup: How to manipulate progress bar on Run section?

旧街凉风 提交于 2019-11-27 05:08:49
Similar to this question: How to set the progress bar value in the [Run] section of the Inno Setup install script? When the Inno Setup gets to the [Run] section, the progress bar shows at 100% and stops in this position. I have many files that I install in this Run section, which I wish to restart the progress bar and control it, as it goes installing each program. The status message is easy to change ( StatusMsg ), but the progress I'm missing something. Could you guys help me out, please? Example: [Run] Filename: "msiexec.exe"; Parameters: "/i ""msxml.msi"" /quiet"; \ StatusMsg: "MSXML...";

Read bytes from file at desired position with Inno Setup

大憨熊 提交于 2019-11-27 04:44:26
问题 I want to open a 50 MB binary file and read only the last 4 bytes and convert it to string for some purpose. The only way I found to do it now is using LoadStringFromFile , to load the file entirely on the memory then copy that last 4 bytes, however this method is very slow because the binary file is heavy. Is there any better way to do it in Inno Setup script? Update : This is a final working function that I edited from Martin Prikryl's answer function readlast4byte() : AnsiString; var

Inno Setup Pascal Script - Reading UTF-16 file

匆匆过客 提交于 2019-11-26 23:24:48
问题 I have an .inf file exported from Resource Hacker. The file is in UTF-16 LE encoding. EXTRALARGELEGENDSII_INI TEXTFILE "Data.bin" LARGEFONTSLEGENDSII_INI TEXTFILE "Data_2.bin" NORMALLEGENDSII_INI TEXTFILE "Data_3.bin" THEMES_INI TEXTFILE "Data_4.bin" When I load it using the LoadStringFromFile function: procedure LoadResources; var RESOURCE_INFO: AnsiString; begin LoadStringFromFile(ExpandConstant('{tmp}\SKINRESOURCE - INFO.inf'), RESOURCE_INFO); Log(String(RESOURCE_INFO)); end; I am getting

Replace placeholder in an installed text file with input entered by user

耗尽温柔 提交于 2019-11-26 23:19:51
问题 As part of an Inno Setup built installer, I want to output the text field that the user enters into the installer to a text file. So far I have the below: [Code] var PrimaryServerPage: TInputQueryWizardPage; PrimaryAddress: String; procedure InitializeWizard; begin PrimaryServerPage := CreateInputQueryPage(wpWelcome, 'Primary Server Details', 'Where is you application installed?', 'Please specify the IP address or hostname of your Primary Server, ' + 'then click Next.'); PrimaryServerPage.Add

Inno Setup: Working with JSON

爷,独闯天下 提交于 2019-11-26 23:16:25
问题 How can I load and work with JSON config file during install time? I can read string from file and write it, but if I want to change some value in config file, I have to use VBScript.RegExp COM object (which is good, but painful and slow to develop). Current method: ExtractTemporaryFile('config.json'); filename := ExpandConstant('{tmp}\config.json'); LoadStringFromFile(filename, conf); objRegExp := CreateOleObject('VBScript.RegExp'); objRegExp.Pattern := 'test'; conf := objRegExp.Replace(conf

Multiple images display (slideshow) on wpInstalling Page under ProgressGauge bar in Inno Setup

无人久伴 提交于 2019-11-26 22:24:12
问题 I have prepared simple script that displays image under ProgressGauge bar on wpInstalling Page. But... I need more complex functionality. What I need is multiple images show, each after X (e.g. 7) seconds (with loop when installation longer then X secs * number of images) or each after X (e.g. 10) percent of installation. I have tried to embed images display in ProgressGauge.Position , but I failed. Here is what I have: procedure CurPageChanged(CurPageID: Integer); var BmpFile: TBitmapImage;

How to get the local IP address using Inno Setup

て烟熏妆下的殇ゞ 提交于 2019-11-26 21:34:08
问题 How can I get user's local IP address using Inno Setup? I thought about using Win32 API GetIpAddrTable , but it is unclear how to make the adjustment. Dos someone have any other way? Or know how to do it? 回答1: It depends on if you want IPv4 address or the IPv6 address. But since you mentioned GetIpAddrTable and it only returns IPv4 addresses, I suspect that is what you wanted. Each machine can have more than one local IP address. So I return them as a TStringList . The machine I tested the