0

I want to extract the msi file of the application I created with Electron and after the msi file runs, an input field such as url, ip address will be output to the user and the value entered here will be set to a file in the application.

I have a desktop application written with Electron. I am getting msi file with Electron-builder. When I run the msi file I have obtained, I want the uploading user to enter a parameter such as url, ip and set this parameter to the config.json file in the application. How can I do that? I also tried to do it with electron-wix-msi but I couldn't.

Adriaan
  • 17,741
  • 7
  • 42
  • 75
  • Is [this SO answer](https://stackoverflow.com/questions/75258108/how-to-make-electron-app-configurable-in-the-release-version/75271125#75271125) something similar to what you are trying to achieve? – midnight-coding Mar 17 '23 at 20:21
  • nope, what is mentioned here is about installing database and running it. What I'm trying to do is request an ip address for a program running on-premise. – Atakan Aydınbaş Mar 20 '23 at 08:02
  • I solved with [this](https://stackoverflow.com/a/55538792/16767912) solution. I just need to set property to .ini file. – Atakan Aydınbaş Mar 22 '23 at 09:14

1 Answers1

0

I don't know ElectroJS, but if you are using WiX to author your MSI, you can prompt the user to enter some values during install and store them into public properties, then use those properties to create files on disk via a custom action.

Something like this in your wxs file:

<Property Id='IPADDR' Value='10.10.10.1'/>

<UI>
  <Dialog Id="MyDlg">
    <Control Id="IPAddrEdit" Type="Edit" X="640" Y="480" Width="128" Height="36" Property="IPADDR"/>
  <Dialog>
<UI>
JPh
  • 536
  • 3
  • 20
  • I've seen something like this before, but I couldn't see how to create a new file or change a value in the file. I'm also having trouble adding a custom template for the electron-wix-msi library. – Atakan Aydınbaş Mar 20 '23 at 08:04
  • The above will prompt the user, you will need to use a deferred CustomAction to create the file. The following answer should give you a starting point: https://stackoverflow.com/questions/835624/how-do-i-pass-msiexec-properties-to-a-wix-c-sharp-custom-action – JPh Mar 21 '23 at 14:54