pascalscript

How to select XML tag based on value of its child tag in Inno Setup

ε祈祈猫儿з 提交于 2019-12-04 20:07:08
I'm trying to search for a text "LIBRA ESTERLINA" in a child element of XML element and retrieve values of others child elements. But my query yields nothing. My code is based on response from How to read multiple XML nodes? (Inno Setup) and response from XPath: How to select elements based on their value? function LoadValuesFromXMLMoneda(FileName: string): Boolean; var XMLNode: Variant; XMLNodeList: Variant; XMLDocument: Variant; Index: Integer; id, moneda, dollar, abr, singPlur, caracter : String; begin XMLDocument := CreateOleObject('Msxml2.DOMDocument.6.0'); try XMLDocument.async := False;

List all physical printers using WMI query in Inno Setup

倖福魔咒の 提交于 2019-12-04 20:02:30
I'm trying to get the list of physical printer's name, that are connected to Windows, based on an answer from Query available RAM in Inno Setup . But just get: "Send To OneNote 16". Here is my query: Query := 'SELECT Name FROM Win32_Printer'; Printer := WbemQuery(WbemServices, Query); if not VarIsNull(Printer) then begin Log(Format('Printers=%s', [Printer.Name])); end; You have to iterate the result set: var Query: string; WbemLocator, WbemServices, WbemObjectSet: Variant; Printer: Variant; I: Integer; begin WbemLocator := CreateOleObject('WbemScripting.SWbemLocator'); WbemServices :=

Prevent duplicate items in list box and combo box in Inno Setup?

依然范特西╮ 提交于 2019-12-04 19:25:30
I receive an XML file from internet (values ​from XML ​may vary, cause there are currencies). And then I load it to a list box 1. A user can add items to to list box 2 with some buttons (one by one, all, delete etc). So I want to prevent duplicates. I can't find any way to do this. My list boxes: Here is my code (for XML parsing part, see How to read multiple XML nodes? (Inno Setup) ): XMLNodeList := XMLDocument.SelectNodes('//listaPaises/item'); for Index := 0 to XMLNodeList.length - 1 do begin XMLNode := XMLNodeList.item[Index]; { Add country } comboBoxPais.Items.Add(XMLNode.SelectSingleNode

How to find an unique name to rename/archive old directories in Inno Setup

夙愿已清 提交于 2019-12-04 19:21:51
Whenever I do a new install, I install a new directory. I am having issues with installing over old directories and would now like to archive my old directories. If DirExists returns true, I want to rename the directory from Directory to DirectoryOld1 . The issue I am having is how to check and iterate through the renaming process, so that if DirectoryOld1 exists, rename the current directory to DirectoryOld2 and so on. If I understand your question correctly, you want to backup an existing directory to a unique (incremented) name. Right? This will do: function BackupDir(OldName: string):

Can't get package references registered to an instance of Visual Studio 17 and above from Pascal Script

馋奶兔 提交于 2019-12-04 19:09:50
I need to define whether a specific extension is installed in Visual Studio 2017. I can get package references registered to the instance of VS using Microsoft.VisualStudio.Setup.Configuration.Interop with C#. Here is example of the working code: var query = (ISetupConfiguration2) new SetupConfiguration(); var e = query.EnumInstances(); int fetched; var instances = new ISetupInstance[1]; do { e.Next(1, instances, out fetched); if (fetched <= 0) continue; ISetupInstance2 instance = instances[0] as ISetupInstance2; if (instance == null) continue; var temp = instance.GetPackages(); var temp2 =

Inno Setup: Disable already installed components on upgrade

被刻印的时光 ゝ 提交于 2019-12-04 18:55:50
We have actually a setup who has many components choice during install and we want to disable component already installed (or make it grey / fixed) when customer reinstall our software. For example during first install we have 3 component like this: Component * International * French * German During first install, all components can be selected. Recognize that chooses the "German" pack, when user make a reinstall of product (with the same installer) to get a new language pack, we want to have something like that: Component * International * French * German (already installed) Where "German"

Inno Setup unable to find and execute ie4uinit.exe on x64 [duplicate]

寵の児 提交于 2019-12-04 18:22:21
This question already has an answer here: A command in a .bat file is unrecognized when the .bat file is called from an Inno Setup but works fine when I run the bat file manually 2 answers I am trying to refresh the Windows icon cache using the well known and documented method of calling ie4uinit.exe -ClearIconCache for anything below Window 10 and ie4uinit.exe -Show on Windows 10 and above: [Run] Filename: "{sys}\ie4uinit.exe"; Parameters: "-ClearIconCache"; StatusMsg: "Rebuilding Windows icon cache..."; Flags: runhidden; Check: not IsWindows10AndAbove Filename: "{sys}\ie4uinit.exe";

Inno Setup refresh desktop

陌路散爱 提交于 2019-12-04 17:07:56
Is it possible to refresh the desktop using Inno Setup in the [Code] section? Either by using SendMessage or somehow use SHChangeNotify ? Andreas Rejbrand You can call any function in the Windows API by calling it in the appropriate DLL. The Pascal DLL syntax is documented here . The documentation of the SHChangeNotify function is found at MSDN as usual. This function is found in Shell32.dll (no surprise!). [Code] const SHCNE_ASSOCCHANGED = $08000000; SHCNF_IDLIST = $00000000; procedure SHChangeNotify(wEventID: integer; uFlags: cardinal; dwItem1, dwItem2: cardinal); external 'SHChangeNotify

InnoSetup, prevent installation if any task is selected

左心房为你撑大大i 提交于 2019-12-04 16:50:14
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? There is no way to do what you want natively in Inno Setup. You will need to do it from code by yourself. You can cheat here a bit by

Get Image File Information using MediaInfo library in Inno Setup Pascal Script

你离开我真会死。 提交于 2019-12-04 16:39:21
I have been trying for more than two days to get JPEG Image and MP4 Video File Information using MediaInfo.DLL in my Pascal Script. But I keep getting error Runtime Error (at 6:366) - Access Violation at address 0042FD23. Read of address 8065241E.' The error mostly points to (at 6:366). I can't think what problem is causing this exception when trying to get Media Information using MediaInfo.DLL. The code I added to my Script: [Files] Source: Lamborghini_Aventador.jpg; DestDir: {tmp}; Flags: dontcopy Source: MediaInfo.dll; DestDir: {tmp}; Flags: dontcopy [Code] #ifdef UNICODE type PWideChar =