pascalscript

Inno Setup Iterate over [Files] section in Pascal code

一世执手 提交于 2019-12-01 08:26:26
In an Inno Setup script, I need to copy a number of files to multiple user-defined locations. In order to do this, I'd like to iterate over the sources in the [Files] section, and FileCopy() them multiple times depending on the user-defined settings and properties of the files. Is it possible to access the sources in the [Files] section using a script? No, you cannot iterate the [Files] section. But you can use preprocessor to generate both the [Files] section and the Pascal Script from one list of files. You are not very specific about your goals, so I'm showing only a rough concept. ; Define

How do I uninstall related products in Inno Setup using an InstallShield Upgrade Code GUID

巧了我就是萌 提交于 2019-12-01 08:11:18
问题 Our company has switched from using InstallShield Express to using Inno Setup (5.5.2 version). We've got years of old installs utilizing InstallShield, but have always relied on InstallShield's Upgrade Code GUID to handle the uninstall of the previous version. I need to be able to uninstall any previous InstallShield installed version from our new Inno Setup installer. After some research it looks like I need to call MsiEnumRelatedProducts() and then uninstall any found products. I found this

Iterate SWbemObjectSet in Windows XP and Inno Setup

佐手、 提交于 2019-12-01 08:03:00
问题 I have a problem with taking MAC-addresses list in Windows XP from Inno Setup installer. I'm trying to write some code (took it from Get MAC address in Inno Setup): function GetMacAddressesList(out List: Array of String): Integer; var I: Integer; WQLQuery: string; WbemLocator: Variant; WbemServices: Variant; WbemObject: Variant; WbemObjectSet: Variant; begin Result := 0; WbemLocator := CreateOleObject('WbemScripting.SWbemLocator'); WbemServices := WbemLocator.ConnectServer('localhost', 'root

Inno Setup Iterate over [Files] section in Pascal code

允我心安 提交于 2019-12-01 07:09:32
问题 In an Inno Setup script, I need to copy a number of files to multiple user-defined locations. In order to do this, I'd like to iterate over the sources in the [Files] section, and FileCopy() them multiple times depending on the user-defined settings and properties of the files. Is it possible to access the sources in the [Files] section using a script? 回答1: No, you cannot iterate the [Files] section. But you can use preprocessor to generate both the [Files] section and the Pascal Script from

Create a hardlink with Inno Setup

為{幸葍}努か 提交于 2019-12-01 07:07:51
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 Styles Source: {tmp}\uninstall.vsf; DestDir: {app}; Flags: ignoreversion Source: {tmp}\uninstall.dll;

Inno Setup - External .NET DLL with dependencies

杀马特。学长 韩版系。学妹 提交于 2019-12-01 06:20:13
问题 I am trying to use a custom DLL in a Inno Setup script during installation. I wrote a very simple function that basically checks a connection string for a MySQL database using MySQL .NET connector (there is no MySQL client on the target server). The code of this exported function is: public class DbChecker { [DllExport("CheckConnexion", CallingConvention.StdCall)] public static int CheckConnexion([MarshalAs(UnmanagedType.LPStr)] string connexionString) { int success; try { MySqlConnection

Get the path in the wpSelectDir before {app} is set Inno Setup

吃可爱长大的小学妹 提交于 2019-12-01 05:59:34
问题 I would like to get the path of the install directory, when the user clicks on Next , when I'm in the wpSelectDir of Inno Setup. I need to check the path, because I need to verify the path, and if it's not correct, I won't let the user continue. My problem is that the constant {app} is not set yet, because it will be set after the wpSelectDir and I'm still in. 回答1: Use WizardDirValue support function: Returns the current contents of the edit control on the Select Destination Location page of

Is it possible to allow a user to skip a TInputDirWizardPage in Inno Setup?

泄露秘密 提交于 2019-12-01 05:58:53
I have an installer using Inno Setup that allows the user to select a file location, at install time. The file is kind of like an answers file to help with installation. For this prompt, I'm using the TInputDirWizardPage. It works fine when the user is using this file, but if he doesn't wish to, it automatically throws an error telling him that he must enter a path. Is there a way to NOT force validation so that the user can just hit next and let me figure out that he doesn't have a file? Unfortunately no. This is hardcoded in the TInputDirWizardPage.NextButtonClick method, which internally

Inno Setup Section [Run] with condition

Deadly 提交于 2019-12-01 04:27:28
问题 I need a help with condition in [Run] . If it's possible... I need to run a command that depends on a condition. Like this: if (UserPage.Values[0] = 'NC') then FileName: {sys}\inetsrv\appcmd.exe; Parameters: "set......" Or other way to do it. Regards. 回答1: You are looking for the Check parameter: [Run] FileName: "{sys}\inetsrv\appcmd.exe"; Parameters: "set......"; Check: ShouldRun [Code] function ShouldRun: Boolean; begin Result := (UserPage.Values[0] = 'NC'); end; 来源: https://stackoverflow

Restore previously entered data on custom page next time Inno Setup-made installer is executed

百般思念 提交于 2019-12-01 02:20:42
I want to use this code, but the part of the code to uninstall I need: in the next time I open the executable it can read the information written in this field 'Service name'. Can help me? And even now where it stores this information written in the 'Service name'? Relaced to: How do I record user input during install, so it can be used during uninstall? TLama If I understand you correctly, you're looking for a way to fill an input field with the previously stored data. In the example that you linked you can notice that there is used the GetPreviousData function which is used just for reading