pascalscript

Determine Windows version in Inno Setup

喜欢而已 提交于 2019-11-26 21:25:16
问题 I'm using Inno Setup to change the recycle bin in the OS. I need to make some cases for if the user is running Windows 7 or Windows XP. I try using: if not FileExists(winDir + '\System32\imageres.dll') then if not FileExists(winDir + '\System32\shell32.dll') then installError(3); But it seems like it can't find imageres.dll or shell32.dll even though I've verified they exist. What am I doing wrong? Or can I check the Windows version another way? 回答1: You should use the GetWindowsVersionEx

Inno Setup Get progress from .NET Framework 4.5 (or higher) installer to update progress bar position

我的梦境 提交于 2019-11-26 20:50:20
问题 I am currently installing .NET Framework 4.6.2 as a prerequisite in the PrepareToInstall event function so that I can obtain the exit code, set the NeedsReboot status, or abort if installation fails. My code is below and this is all working fine. var PrepareToInstallLabel: TNewStaticText; PrepareToInstallProgressBar: TNewProgressBar; intDotNetResultCode: Integer; CancelWithoutPrompt, AbortInstall: Boolean; function InitializeSetup(): Boolean; begin Result := True; OverwriteDB := False;

Proper structure syntax for Pascal if then begin end and ;

僤鯓⒐⒋嵵緔 提交于 2019-11-26 20:47:49
It has been around 20 years since I last had to write in Pascal. I can't seem to use the structure elements of the language correctly where I am nesting if then blocks using begin and end . For example this gets me an Compiler Error "Identifier Expected" . procedure InitializeWizard; begin Log('Initialize Wizard'); if IsAdminLoggedOn then begin SetupUserGroup(); SomeOtherProcedure(); else begin (*Identifier Expected*) Log('User is not an administrator.'); msgbox('The current user is not administrator.', mbInformation, MB_OK); end end; end; Of course if I remove the if then block and the begin

Inno Setup - Language selector with VCL Styles

杀马特。学长 韩版系。学妹 提交于 2019-11-26 17:28:59
问题 Is there any way to use language selector (Inno Setup) with VCL Styles? How? 回答1: The "Select Setup Language" dialog displays before the InitializeSetup event function is called. So you cannot load the skin for the dialog. As a workaround, you can implement your own "language" dialog, and display that from the InitializeSetup . This way the custom dialog will be skinned. Once a user selects a language, you restart the installer with the /LANG switch to load the selected language. Make sure

Use two/multiple selected directories from custom page in Files section

安稳与你 提交于 2019-11-26 17:25:37
问题 I need create custom page of two destination. I've done: #define MyAppName "TESTPROG" [Setup] AppName={#MyAppName} DefaultDirName=C:\test\{#MyAppName} DefaultGroupName={#MyAppName} [Code] var Page: TInputDirWizardPage; DataDir: String; procedure InitializeWizard; begin Page := CreateInputDirPage(wpWelcome, 'Select Personal Data Location', 'Where should personal data files be stored?', 'Personal data files will be stored in the following folder.'#13#10#13#10 + 'To continue, click Next. ' + 'If

Writing binary file in Inno Setup

点点圈 提交于 2019-11-26 17:08:57
问题 How does one write to a binary file in Inno Setup script? It's a configuration file I want to edit in the PrepareToInstall step. The problem is that I'm looking at the support functions: TStream = class(TObject) function Read(Buffer: String; Count: Longint): Longint; function Write(Buffer: String; Count: Longint): Longint; function Seek(Offset: Longint; Origin: Word): Longint; procedure ReadBuffer(Buffer: String; Count: Longint); procedure WriteBuffer(Buffer: String; Count: Longint); function

Access file list via script in InnoSetup

℡╲_俬逩灬. 提交于 2019-11-26 11:37:05
问题 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. 回答1: 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

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

浪尽此生 提交于 2019-11-26 11:26:35
问题 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?

Inno Setup: copy folder, subfolders and files recursively in Code section

谁说胖子不能爱 提交于 2019-11-26 10:47:17
Is there any way to browse and recursively copy/move all files and subdirectories of a directory within the code section? ( PrepareToInstall ) I need to ignore a specific directory, but using xcopy it ignores all directories /default/ , for example, and I need to ignore a specific only. The Files section is executed at a later time when needed. Martin Prikryl To recursively copy a directory programmatically use: procedure DirectoryCopy(SourcePath, DestPath: string); var FindRec: TFindRec; SourceFilePath: string; DestFilePath: string; begin if FindFirst(SourcePath + '\*', FindRec) then begin

“Identifier Expected” or “Invalid Prototype” when implementing a scripted constant in Inno Setup

我的未来我决定 提交于 2019-11-26 09:57:30
问题 So given this function, I get the error \"Identifier Expected\" on the GetRoot := ROOTPage.Values[0]; line. I expect it is telling me that the ROOTPage is not defined? const DefaultRoot = \'C:\\IAmGRoot\'; Var ROOTPage : TInputQueryWizardPage; procedure SetupRoot; begin ROOTPage := CreateInputQueryPage(wpUserInfo, ExpandConstant(\'{cm:RootTitle}\'), ExpandConstant(\'{cm:RootInstructions}\'), ExpandConstant(\'{cm:RootDescription}\') + \' \"\' + DefaultRoot + \'\"\' ); ROOTPage.Add