-1

I have a setup built in InnoSetup and i need to convert it to msi. I use msiwrapper.

The setup file needs some arguments for automated install, eg:

setup.exe /var_a=1 /var_b=2

I need also to convert it to MSI, so i use msiwrapper. it is possible to pass arguments to the setup executable using the argument WRAPPED_ARGUMENTS.

So if i run it like this, it works:

msiexec /i "setup.msi" /quiet WRAPPED_ARGUMENTS="/var_a=1"

my problem is to use aditional variables, i cant find a place with such example. Already tried several approaches with no success. Anyone has a clue for this to work?

unsuccessfull examples:

msiexec /i "setup.msi" /quiet WRAPPED_ARGUMENTS="/var_a=1 /var_b=2"
msiexec /i "setup.msi" /quiet WRAPPED_ARGUMENTS="/var_a=1,/var_b=2"
msiexec /i "setup.msi" /quiet WRAPPED_ARGUMENTS="/var_a=1|/var_b=2"
msiexec /i "setup.msi" /quiet WRAPPED_ARGUMENTS="/var_a=1","/var_b=2"

and so on...

r3v3r53
  • 142
  • 1
  • 1
  • 10
  • 1
    I'm not sure what MSIWrapper is, or indeed what the point is of wrapping an EXE into an MSI file since you won't harness the resiliency features of Windows Installer (rollback, self repair, self healing etc). In any case, your first 'unsuccessful example' looks ok to me so I'd add some Windows Installer logging to see what's going on. I imagine the MSI will initiate the setup.exe via a custom action, so use "msiexec..... /l*v c:\temp\setup.log" and search the log file for the resultant setup.exe command line.... – Captain_Planet Sep 19 '19 at 07:16

1 Answers1

0

It is a bit improvised, but I have a program (EXE) and I need to create an installer, I did it using InnoSetup, however it is a requirement that the installer be in msi format for GPO installation.

(Next time, probably, i should use visual studio to create the installer...)

I need to pass some variables in the install command through msiexec. This can be done with the WRAPPED_ARGUMENTS argument, the problem is passing multiple arguments to the WRAPPED_ARGUMENTS.

I realized that the real problem was escaping the space character.

Problem solved by creating the install command like sugested by mklement0 anwser to this post, using "--%":

msiexec.exe --% "setup.msi" WRAPPED_ARGUMENTS="/var_a=1 /var_b=2"
r3v3r53
  • 142
  • 1
  • 1
  • 10