WiX: how to run a command prompt after installation

I need to register an HTTP port after installation, but I assume that it can be abstracted to execute any command line command. Here is what I have so far:

<CustomAction Id="ExecPortOpen" Directory="INSTALLFOLDER" Execute="immediate" ExeCommand="cmd.exe &quot;netsh http add urlacl url=http://+:1234/ user=Everyone&quot;" Return="ignore" /> <InstallExecuteSequence> <Custom Action="ExecPortOpen" After="InstallFinalize" /> </InstallExecuteSequence> 

It just opens the command line in the middle of the installation and does nothing with it. I tried adding / c (I have no idea what this does) between cmd.exe and the command, but it only opens and closes the command line without executing the command. How to do it? I am using WiX 3.8.

+6
source share
1 answer

Solved myself, was actually a UAC / permissions issue. For any interested parties, here is a working code:

 <CustomAction Id="ExecPortOpen" Directory="INSTALLFOLDER" Execute="commit" Impersonate="no" ExeCommand="cmd.exe /c &quot;netsh http add urlacl url=http://+:1234/ user=Everyone&quot;" Return="check" /> <InstallExecuteSequence> <Custom Action="ExecPortOpen" After="InstallInitialize" /> </InstallExecuteSequence> 
+10
source

Source: https://habr.com/ru/post/976767/


All Articles