How to pass in arguments via msiexec and apply it in exeCommand in custom action

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to pass in arguments via msiexec and apply it in exeCommand in custom action

tingkeeyong
This post has NOT been accepted by the mailing list yet.
Hi, I am a beginner to wix toolset, and I don't have much clue about its syntax.

I want to pass in parameters while running setup via msiexec, so that the custom action can grep the parameters and run cmd.exe based the parameters. An example code can be viewed below.

<Property Id="domain" Admin="yes" value=""/>
<Property Id="userName" Admin="yes" value=""/>   
<Property Id="password" Admin="yes" value=""/>

<CustomAction
                  Id            ="installService"  
                  Directory  ="INSTALLLOCATION"
                  ExeCommand ='"C:\folder path\PsExec.exe" -u [domain]\[userName] -p [password] "C:\folder\application.exe" '
                 
                  Execute    ="deferred"
                  Impersonate='no'
                  Return     ="check">
</CustomAction>

I've tried the syntax above, but not working, I really have no idea how to pass the parameters into the exeCommand attribute. I really appreciate any guidance on how to make something above to work.

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: How to pass in arguments via msiexec and apply it in exeCommand in custom action

DhavalSomani
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi tingkeeyong,

You need to add one property to run CMD from your custom action..
<Property Id="LAUNCHCMD" Value ="c:\Windows\System32\cmd.exe" />

Your code like as follow :
<Property Id="domain" Admin="yes" value=""/>
<Property Id="userName" Admin="yes" value=""/>
<Property Id="password" Admin="yes" value=""/>

<Property Id="LAUNCHCMD" Value ="c:\Windows\System32\cmd.exe" />

<CustomAction Id="installService"   Directory  ="INSTALLLOCATION" Property="LAUNCHCMD"
                  ExeCommand ='"C:\folder path\PsExec.exe" -u [domain]\[userName] -p [password] "C:\folder\application.exe" '
                  Execute    ="deferred" Impersonate='no' Return="check">
</CustomAction>