pascalscript

Multi-line edit in Inno Setup on page created by CreateInputQueryPage

Deadly 提交于 2019-12-10 10:19:56
问题 By default, when you add a TEdit to a page in Inno Setup, the height is one line. How do I increase the height of the edit? Here is the relevant part of the ISS file ContractConfigPage := CreateInputQueryPage(ServerConfigPage.ID, 'Map contract as JSON', 'Please enter the map contract to use in JSON format', ''); ContractConfigPage.Add('JSON', False); ContractConfigPage.Edits[0].Height := 100; { does not have any effect } Edit: I am now able to have a bigger edit but I can not have multiple

Inno Setup - Progress bar doesn't show when uninstall

纵饮孤独 提交于 2019-12-10 07:38:51
问题 I'm using Inno Setup to create my own installer. When user uninstall app I want delete some folder. So I use CurUninstallStepChanged event to delete folder and show "progress bar" with npbstMarquee style (based on Inno Setup: How to handle progress bar on [UninstallDelete] section?). Here is the code: procedure DeleteFolder(); var FindRec: TFindRec; fullPath: string; tmpMsg: string; StatusText: string; deletePath: string; begin { find all and delete } UninstallProgressForm.ProgressBar.Style :

Inno Setup - Animate a control roll out from right in a determinate page

元气小坏坏 提交于 2019-12-10 00:18:21
问题 I am trying to use this code (with InnoCallback DLL library): [Code] var MainPanelAnimated: Boolean; AnimationTimer: LongWord; procedure AnimationTimerProc( H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord); var L: Integer; begin L := WizardForm.MainPanel.Left + ScaleX(5); if L > 0 then begin L := 0; KillTimer(0, AnimationTimer); end; WizardForm.MainPanel.Left := L; end; procedure CurPageChanged(CurPageID: Integer); var HoverTimerCallback: LongWord; begin if WizardForm

InnoSetup, prevent installation if any task is selected

为君一笑 提交于 2019-12-09 22:43:36
问题 My inno script has two tasks: [Tasks] Name: client; Description: Install FTP client Name: server; Description: Install FTP server I would like to deny the installation in a non-intrusive way if any task is selected, for non.intrusive I mean for example enabling/disabling the "next" button when one of both tasks are checked, no advertising messagbe-box. I'm not sure if innosetup has a parameter or a "check" function to do this in a simple way How I could do it? 回答1: There is no way to do what

How to return a string from a DLL to Inno Setup?

我怕爱的太早我们不能终老 提交于 2019-12-09 17:59:04
问题 I need to return a string value to the calling inno setup script. Problem is I can't find a way to manage the allocated memory. If I allocate on the DLL side, I don't have anything to deallocate with on the script side. I can't use an output parameter, because there is no allocation function in the Pascal Script either. What should I do? 回答1: Here is a sample code of how to allocate a string that returns from a DLL: [code] Function GetClassNameA(hWnd: Integer; lpClassName: PChar; nMaxCount:

Inno Setup - Delete whole application folder except for data subdirectory

五迷三道 提交于 2019-12-09 01:45:41
问题 I usually have no problem backing up savegames, but for this particular game, I use FreeArc, since the game is very large, so Inno Setup doesn't really know which files to delete. With FreeArc, you need to use [UninstallDelete] Type: files; Name: "{app}" But this particular game stores savegames in {app}\data\save . I need a function to move that folder somewhere, uninstall the game, and then move it back. Here's my code: procedure DirectoryCopy(SourcePath, DestPath: string); var FindRec:

Inno Setup Change AppName based on component(s) selected

北城以北 提交于 2019-12-09 01:44:21
问题 I need the installer to show different AppName based on (un)selected components. I tried this: [Setup] AppName={code:GetAppName} AppVersion=1.0 AppVerName=Dagon Video Tools AppId=Dagon Video Tools DefaultDirName={sd}\Games\Dagon Video Tools [Code] function GetAppName(Value: string): string; var CurPageID: Integer; Begin Result := 'Dagon Video Tools' if (CurPageID=wpSelectComponents) and IsComponentSelected('Slasher') and not IsComponentSelected('Frankenstein') then begin Result := 'Dagon

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

梦想与她 提交于 2019-12-08 18:32:38
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.NextButton.Enabled := (CompareText(InputPage6.Values[EditIndex2], 'EX54321') <> 0); If I understand you

Inno Setup invoke or replicate native Windows file copy operation

我怕爱的太早我们不能终老 提交于 2019-12-08 18:31:26
I know that the FileCopy function can be used to copy files in the [Code] section and this works fine for most purposes. However, is there any way to invoke the native Windows file copy operation, so that the standard Windows file copy dialog with progress, time remaining etc is shown (i.e. the same as doing Ctrl+C , followed by Ctrl+V ), which will also allow the user to cancel or pause the copy operation mid-process? Or, better still, is there a way to replicate similar functionality directly in the [Code] section? Use SHFileOperation with FO_COPY : type TSHFileOpStruct = record hwnd: HWND;

How to read registry HKCU for logged In user from Inno Setup installer running as administrator

こ雲淡風輕ζ 提交于 2019-12-08 12:22:36
问题 My setup is set to run with lowest privileges PrivilegesRequired=lowest But I'm executing setup as Admin (right click-> run as admin, enter Admin credential in UAC), and want to check Logged In User's registry in InitializeSetup() function InitializeSetup(): boolean; begin if RegQueryStringValue(HKCU,'SOFTWARE\{some path}','Version', {some value}) then begin { do something here } end end But this checks the registry value for the Admin Account , not for Logged In User Account Is there a way