[wix-users] Running the application (not the MSI) as administrator
Zac Harvey
zharvey at pobox.com
Tue Dec 31 08:50:34 PST 2019
I am very pleased (so thank you!) with how easy WiX 3.11.2 has been to setup and use. I am a Mac/Linux developer that had a rare project crop up that required me to write a Windows application and MSI installer, and WiX has been a joy to work with thus far.
I have my MSI installed correctly installing my application under C:\Program Files (x86)\My App. And when it starts up it works perfectly, *except* one small item:
The app *should* be created a log file in that same directory (so C:\Program Files (x86)\My App\my-app.log). I noticed that although my app starts up and runs just fine (from the end user's perspective), the log file is not created.
So I right-clicked the EXE (C:\Program Files (x86)\My App\my-app.exe) and flagged it to *Run as administrator*, and that seemed to solve the problem. Now, when the app starts up, the log file is created and is written to as expected; all is well.
Its not a *huge* inconvenience to setting this "Run as administrator" flag manually, but ideally, the MSI installer would handle this for me. I came across this article:
https://stackoverflow.com/a/6124767/5235665
...but I think that is for making the MSI installer itself run as the administrator, and I'm not entirely sure thats what I want (is it?). Again, the MSI runs great, its just that at start time, my *app* (not the installer) needs to run as the admin.
Can anyone weigh in as to what I need to do (specifically which commands added to which file) to get my (MSI-installed) app running as administrator?
Thanks for such a great tool, and Happy New Year!
Best,
Zac
More information about the wix-users
mailing list