pascalscript

How can I use GetVolumeInformation in Inno Setup?

感情迁移 提交于 2019-12-04 11:55:26
问题 I need to get the volume serial number for a drive letter during an installation created with Inno Setup. I know that DLL functions can be imported into Inno, but I'm fairly new to it and having some problems getting it to work. I know that the GetVolumeInformation function in kernel32 can do what I need. Could someone show me how to import and use that functionality in an Inno script to retrieve the volume serial number? Thanks! 回答1: Inno-Setup code:: [Code] function GetVolumeInformation(

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

夙愿已清 提交于 2019-12-04 07:11:49
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? Here is a sample code of how to allocate a string that returns from a DLL: [code] Function GetClassNameA(hWnd: Integer; lpClassName: PChar; nMaxCount: Integer): Integer; External 'GetClassNameA@User32.dll StdCall'; function GetClassName(hWnd: Integer): string;

Inno Setup - Show children component as sibling and show check instead of square in checkbox

我是研究僧i 提交于 2019-12-04 02:19:38
问题 I'm trying to have a children component to be shown as sibling. I'm making a installer for a Game which can have multiple versions of the game coexisting in the same installation folder. Now I want to have the ability to install optional mods which require to have a specific version of the game installed (dependency). So when the user clicks on a mod, the required game gets selected, and if the game is deselected, all the mods get deselected. The code as is is working as expected and behaves

Inno Setup - Get a path to parent folder

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 02:10:02
问题 I need to get the parent folder of {app} . It's standard if the end user didn't change the default, but if he did, it becomes a little more problematic. Basically, I need a function, that will output everything till the last \ backslash (inclusive). Wanted to try Pos , but it only detects the first instance of the character. 回答1: Use the ExtractFilePath function: Extracts the drive and directory parts of the given file name. The resulting string is the leftmost characters of FileName, up to

Create a hardlink with Inno Setup

人盡茶涼 提交于 2019-12-04 01:38:33
问题 I have thousand of own installers that requires a critical dll file for uninstallation step, this dll file sizes about 2 mb then to avoid unnecessary disk space (2mb*100 installers) I would like to store the file once in {cf} then make a hardlink for the next installers that requires that file. I could create a hardlink in Inno Setup without the need of external apps such as mklink.exe usage? This is a brief example of what I have, all my installers follow the same "structure": [Files] ; VCL

How to determine whether a specific Windows Update package (KB*.msu) is installed using Inno Setup?

删除回忆录丶 提交于 2019-12-03 20:46:43
I wonder how to determine whether a specific Windows Update package is installed in the target machine, lets say for example the Windows Update package with name KB2919355 . Exists a built-in feature to check that? If not, what would be the required code to determine it? Maybe messing with registry, or maybe a cleanest and/or secure way? Pseudo-Code: [Setup] ... [Files] Source: {app}\*; DestDir: {app}; Check: IsPackageInstalled('KB2919355') [Code] function IsPackageInstalled(packageName): Boolean; begin ... Result := ...; end; function IsKBInstalled(KB: string): Boolean; var WbemLocator:

Compare version strings in Inno Setup

那年仲夏 提交于 2019-12-03 20:39:18
I'm reading the value of an INF file, now I need to compare it with the installer version, but when I compile I get an error: Unknown identifier: CompareVersion What is wrong? [Code] function GetKeyValue(const AKeyName, AFileName, ADefault: string): string; var I: Integer; KeyPos: Integer; KeyFull: string; FileLines: TArrayOfString; begin Result := ADefault; if LoadStringsFromFile(AFileName, FileLines) then begin KeyFull := AKeyName + '='; for I := 0 to GetArrayLength(FileLines) - 1 do begin FileLines[I] := TrimLeft(FileLines[I]); KeyPos := Pos(KeyFull, FileLines[I]); if KeyPos > 0 then begin

Inno Setup - Create a dynamic list of components/types from external source (file or folder contents)

♀尐吖头ヾ 提交于 2019-12-03 20:31:59
I have a batch file (setting changer) that uses xcopy to list specific files formats in a specific folder, then allows me to type in one of the names and the script uses that name to copy that file to another location. First xcopy creates a copy of the original as a backup ( rolling backup only 1 copy ) then does the file copy (extension is fixed in batch only body of filename needed This works great BUT I would love to try and do this in Inno Setup for a nice clean GUI. I would like to populate the list of components/types from this list of files found in a specific fixed folder. Or even

How do you find the user-selected install path in Inno Setup?

限于喜欢 提交于 2019-12-03 18:03:56
问题 I need to get the path that the user chose to install my application into. If I set CreateAppDir=yes and set a DefaultDirName=C:\MyApp\ the user can change it to some other directory. After they do this, I need to know which directory they chose on the next install wizard step. How can I get this value? 回答1: Use the {app} constant. The reference describes it as: The application directory, which the user selects on the Select Destination Location page of the wizard. For example: If you used

How can I use GetVolumeInformation in Inno Setup?

巧了我就是萌 提交于 2019-12-03 08:13:23
I need to get the volume serial number for a drive letter during an installation created with Inno Setup. I know that DLL functions can be imported into Inno, but I'm fairly new to it and having some problems getting it to work. I know that the GetVolumeInformation function in kernel32 can do what I need. Could someone show me how to import and use that functionality in an Inno script to retrieve the volume serial number? Thanks! Inno-Setup code:: [Code] function GetVolumeInformation( lpRootPathName: PChar; lpVolumeNameBuffer: PChar; nVolumeNameSize: DWORD; var lpVolumeSerialNumber: DWORD; var