pascalscript

Check an IP address against an online list in Inno Setup

与世无争的帅哥 提交于 2021-02-19 08:07:14
问题 I am getting the user IP address using the below code function GetIp: string; var WinHttpReq: Variant; begin try WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1'); WinHttpReq.Open('GET', 'http://ipinfo.io/ip', False); WinHttpReq.Send; Result := Trim(WinHttpReq.ResponseText); except Log(GetExceptionMessage); Result := '8.8.8.8'; end; end; After getting the users IP address I need to check if that IP address already exists in my online JSON list. Thanks 回答1: The simplest solution is

Why is it not recommended to use HKCR registry root key in Inno Setup?

依然范特西╮ 提交于 2021-02-19 08:06:29
问题 I have to write a value to the HKEY_CLASSES_ROOT key. In order to do that I would write: RegWriteStringValue(HKCR, '<Root>', '<SubKey>', '<Value>'); But when I looked in the documentation I saw this: Using HKCR is not recommended, use HKA with the Subkey parameter set to "Software\Classes" instead. I'd like to know what's the difference between the two? Also, I've noticed that in the examples in the documentation they use HKEY_AUTO instead of HKA . Are those the same? 回答1: It is probably

Why is it not recommended to use HKCR registry root key in Inno Setup?

☆樱花仙子☆ 提交于 2021-02-19 08:06:25
问题 I have to write a value to the HKEY_CLASSES_ROOT key. In order to do that I would write: RegWriteStringValue(HKCR, '<Root>', '<SubKey>', '<Value>'); But when I looked in the documentation I saw this: Using HKCR is not recommended, use HKA with the Subkey parameter set to "Software\Classes" instead. I'd like to know what's the difference between the two? Also, I've noticed that in the examples in the documentation they use HKEY_AUTO instead of HKA . Are those the same? 回答1: It is probably

Setting control width to half of custom page SurfaceWidth does not work correctly in Inno Setup

隐身守侯 提交于 2021-02-18 19:09:10
问题 I placed a Panel on my custom page and gave it a width of SurfaceWidth . Then I changed its width to SurfaceWidth div 2 . Here's the result: As you can see from the screenshot the new panel's width is definitely not equal to SurfaceWidth div 2 . Why is that so? Here's the code: [Setup] WizardStyle=modern [Code] procedure InitializeWizard(); var Page: TWizardPage; Panel: TPanel; begin Page := CreateCustomPage(wpWelcome, 'Custom wizard page controls', 'TButton and others'); Panel := TPanel

Setting control width to half of custom page SurfaceWidth does not work correctly in Inno Setup

半世苍凉 提交于 2021-02-18 19:07:03
问题 I placed a Panel on my custom page and gave it a width of SurfaceWidth . Then I changed its width to SurfaceWidth div 2 . Here's the result: As you can see from the screenshot the new panel's width is definitely not equal to SurfaceWidth div 2 . Why is that so? Here's the code: [Setup] WizardStyle=modern [Code] procedure InitializeWizard(); var Page: TWizardPage; Panel: TPanel; begin Page := CreateCustomPage(wpWelcome, 'Custom wizard page controls', 'TButton and others'); Panel := TPanel

Inno Setup Remember selected setup type when Uninstallable=no

主宰稳场 提交于 2021-02-18 18:54:15
问题 I am creating an Inno Setup installer that is a little non traditional. I am setting Uninstallable=no but I still need to be able to remember what the user selected for the type of install if they reinstall in the future. I thought about writing the type out to a file which I was able to do. I am not sure how to set the type when the installer is run the next time however. Here is my code for storing the type. procedure CurStepChanged(CurStep: TSetupStep); begin if (CurStep = ssDone) then

Inno Setup Remember selected setup type when Uninstallable=no

此生再无相见时 提交于 2021-02-18 18:53:24
问题 I am creating an Inno Setup installer that is a little non traditional. I am setting Uninstallable=no but I still need to be able to remember what the user selected for the type of install if they reinstall in the future. I thought about writing the type out to a file which I was able to do. I am not sure how to set the type when the installer is run the next time however. Here is my code for storing the type. procedure CurStepChanged(CurStep: TSetupStep); begin if (CurStep = ssDone) then

Inno Setup Remember selected setup type when Uninstallable=no

旧城冷巷雨未停 提交于 2021-02-18 18:52:11
问题 I am creating an Inno Setup installer that is a little non traditional. I am setting Uninstallable=no but I still need to be able to remember what the user selected for the type of install if they reinstall in the future. I thought about writing the type out to a file which I was able to do. I am not sure how to set the type when the installer is run the next time however. Here is my code for storing the type. procedure CurStepChanged(CurStep: TSetupStep); begin if (CurStep = ssDone) then

Add additional controls to standard Inno Setup pages?

天涯浪子 提交于 2021-02-18 18:46:37
问题 How to add checkbox to the folder selection dialog created by the Inno Setup which is shown below in the image? This is not a custom dialog. It is created by the Inno Setup automatically. 回答1: Set the Parent property of the checkbox to the WizardForm.SelectDirPage : var Checkbox: TNewCheckBox; procedure InitializeWizard(); begin Checkbox := TNewCheckBox.Create(WizardForm.SelectDirPage); Checkbox.Parent := WizardForm.SelectDirPage; Checkbox.Top := WizardForm.DirEdit.Top + WizardForm.DirEdit

Inno Setup - Pad a string to a specific length with zeros

青春壹個敷衍的年華 提交于 2021-02-08 10:27:24
问题 Here's what my code currently looks like: var Page: TInputQueryWizardPage; procedure IDKeyPress(Sender: TObject; var Key: Char); var KeyCode: Integer; begin KeyCode := Ord(Key); if not ((KeyCode = 8) or ((KeyCode >= 48) and (KeyCode <= 57))) then Key := #0; end; Procedure InitializeWizard(); Begin Page := CreateInputQueryPage(blahblah); Page.Add('Profile ID:', False); Page.Edits[0].MaxLength := 16; Page.Edits[0].OnKeyPress := @IDKeyPress; Page.Values[0] := '0000000000000000'; End; procedure