I\'m trying to create an .msi installer file with electron-builder (version 20.39.0), that can be parameterized during install time. The parameters (e.g. server endpoint) sh
With the help of Stein Åsmul, this is my current solution:
I took the current WiX template of electron-builder and added an option to write variables to an ini file.
...
The complete template looks like this:
= 601]]>
{{ if (iconPath) { }}
{{ } -}}
{{ if (isAssisted || isRunAfterFinish) { }}
{{ } -}}
{{ if (isPerMachine) { }}
{{ } else { }}
{{ } -}}
{{ if (isAssisted) { }}
{{ } else if (isRunAfterFinish) { }}
{{ } -}}
{{ if (isCreateDesktopShortcut) { }}
{{ } -}}
{{ if (isCreateStartMenuShortcut) { }}
{{ } }}
{{-dirs}}
{{-files}}
Using electron-builder@20.39.0, I create the MSI with
set DEBUG=electron-builder:*
cp template.xml .\node_modules\app-builder-lib\templates\msi\template.xml
electron-builder
And then install the MSI with
MsiExec /i "myapp.msi" MYSERVER=myapp.example.com MYSECONDPROPERTY=helloworld /L*v Install.log
After installation finished, I got the AppConfig.ini in my installdir (%USERPROFILE%\AppData\Local\Programs\MyApp\AppConfig.ini)
[AppConfig]
Server="myapp.example.com"
SecondProp="helloworld"