07-11-2023 04:21 AM - edited 07-11-2023 04:24 AM
is there a way to automatically launch the EXE of a NI customized installer immediately after the end of the installation, as we can see in lots of common software installers?
I've test "installer properties->Advanced -> Run executable at the end of installation" but I realized it's a wrong way to do that.
thanks for your help
07-11-2023 11:42 AM
You can enter your just installed exe into that field, but then it will run with elevated privileges.
To avoid that, you can create a bat file that is called after the installer runs. Give it "[INSTALLDIR]" (including quotation marks) as argument and then in the file something like this:
cd %1
runas /trustlevel:0x20000 "myapp.exe"
I have no prior experience with this, but maybe it helps 😄
07-12-2023 10:34 AM
With the solution above, if the installer was run as a different user (i.e. one with admin privileges) then the application will be executed under that user's account.
Out of curiosity, I looked up how Notepad++ does it and their solution is basically:
"%windir%\explorer.exe" "myapp.exe"
Which apparently launches myapp.exe with the same privileges and as the same user as the explorer process. Drawback is that passing command line arguments does not work.