Search code examples
inno-setuppascalscript

How to replace directory with its constant in a ShellExec line


I have this working line:

ShellExec('',ExpandConstant('{app}\iush.exe'),'/ui "C:\Program Files (x86)\Myapp"', ' ', SW_HIDE, ewWaitUntilTerminated, errorCode)

But i want to replace the Program Files (x86) dirctory with its constant: "C:\Program Files (x86)\Myapp" >> {pf32}\Myapp

Then It would like:

ShellExec('',ExpandConstant('{app}\iush.exe'),'/ui "{pf32}\Myapp"', ' ', SW_HIDE, ewWaitUntilTerminated, errorCode)

Solution

  • ShellExec('',ExpandConstant('{app}\iush.exe'),ExpandConstant('/ui "{pf32}\Myapp"'),'',SW_HIDE,ewWaitUntilTerminated,errorCode);