[wix-users] Running the application (not the MSI) as administrator
Rob Mensching
rob at firegiant.com
Tue Dec 31 09:20:50 PST 2019
%TMP%\ unless you need to keep them forever (for some reason?) then %LocalAppData%\<CompanyName>\.
Short replies here. Complete answers here: https://www.firegiant.com/services/
-----Original Message-----
From: Zac Harvey <zharvey at pobox.com>
Sent: Tuesday, December 31, 2019 9:10 AM
To: Rob Mensching <rob at firegiant.com>; Zac Harvey via wix-users <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Running the application (not the MSI) as administrator
Thanks Rob, where do modern Windows apps typically write log files? Is there a standard? Generally speaking I try to *not* fight convention wherever I can ;-)
Thanks,
Zac
On Tue, Dec 31, 2019, at 11:59 AM, Rob Mensching wrote:
> Put your log file somewhere else. Trying to write to the application
> folder is anti-security since ~2006.
>
> -----Original Message-----
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of
> Zac Harvey via wix-users
> Sent: Tuesday, December 31, 2019 8:51 AM
> To: wix-users at lists.wixtoolset.org
> Cc: Zac Harvey <zharvey at pobox.com>
> Subject: [wix-users] Running the application (not the MSI) as
> administrator
>
> 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
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
More information about the wix-users
mailing list