According to Getting and Setting Properties (Windows Installer), you can get and set property values from programs using MsiGetProperty and MsiSetProperty and include as part of conditional statements in the installation database. Windows Installer Examples attached.
WiX MSI installer add optional true/false flag passthrough to Electron app
Currently I am building an Electron project to a MSI installer using electron-builder, which comes with a WiX template.xml that it uses to generate the MSI installer.
Is there a way to configure/edit the installer so my Electron app can know what optional parameters, specifically parameters set with Msiexec.exe
, it was installed with?
Essentially I need the Electron app to know what options it was installed with, preferably without installing an extra file.
I've done a little research on this and the only way I found to get this sort of behavior is to optionally install a file that my app would then try to detect, where if the file is present it would mean optionalparam=true
and if the file was not present it would mean optionalparam=false
. But is there a better way?
e.g.
I install my electron app with Msiexec.exe /i "install.msi" /qn /norestart optionalparam=true
Then the installer should push what install parameters were used (what 'optionalparam' was set to, where unset = false
)
or
My installed Electron app should be able to call some API functions to eventually determine what installer parameters were used
1 answer
Sort by: Most helpful
-
Xiaopo Yang - MSFT 12,726 Reputation points Microsoft Vendor
2021-08-25T07:33:41.427+00:00