[wix-users] Running the application (not the MSI) as administrator

Gmail pete.jenney at gmail.com
Tue Dec 31 10:08:10 PST 2019


You should put it in AppData. Here’s how to get it in .Net Core

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Here’s a Stackoverflow link: https://stackoverflow.com/questions/867485/c-sharp-getting-the-path-of-appdata
 
Cheers!

Pete

LinkedIn: http://www.linkedin.com/in/pjenney


> On Dec 31, 2019, at 12:18 PM, Zac Harvey via wix-users <wix-users at lists.wixtoolset.org> wrote:
> 
> 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/
>> 
> 
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list