Discussion:
[WiX-users] Unable to add files in C:\Program Files (x86)\MyApp
Kshama Bafna (Persistent Systems Private Ltd)
2010-06-04 14:33:26 UTC
Permalink
Hi,

I have created an MSI using WIX and the installation is done correctly by the MSI. When I install my application to D:\MyApp, the application works fine and as expected it writes a few files in the same location. However, when I install the application at C:\Program Files (x86)\MyApp location, the application is unable to write the files in the installed location and it throws an exception 'Access Denied'. I do not get this exception when I run the application as 'Run as Administrator'.

Please let me know how can I get rid of this exception. Are there any permissions which could be set in the WIX file for the folder?

Thanks in advance,
Kshama
Rob Hamflett
2010-06-04 14:52:15 UTC
Permalink
It's because the folder is read-only unless you have full admin rights. You can have the installer
make it writable like this:
<Directory Id="examples" Name="examples">
<Component Id="examples_permissions" Guid="GUID_GOES_HERE">
<CreateFolder>
<Permission GenericAll="yes" Read="yes" ReadAttributes="yes" CreateChild="yes" Delete="yes"
DeleteChild="yes" WriteAttributes="yes" User="Everyone" />
</CreateFolder>
</Component>
</Directory>

Rob
Post by Kshama Bafna (Persistent Systems Private Ltd)
Hi,
I have created an MSI using WIX and the installation is done correctly by the MSI. When I install my application to D:\MyApp, the application works fine and as expected it writes a few files in the same location. However, when I install the application at C:\Program Files (x86)\MyApp location, the application is unable to write the files in the installed location and it throws an exception 'Access Denied'. I do not get this exception when I run the application as 'Run as Administrator'.
Please let me know how can I get rid of this exception. Are there any permissions which could be set in the WIX file for the folder?
Thanks in advance,
Kshama
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
http://p.sf.net/sfu/thinkgeek-promo
Wilson, Phil
2010-06-04 16:36:10 UTC
Permalink
This type of thing is common when moving to a UAC system. I suspect your OS version uses UAC, so:

1. I would recommend you look at user profile data folders for this kind of data storage.

2. Maybe your app has always required admin privileges but now you're on a UAC system, so maybe you need an elevation manifest?

Phil Wilson


-----Original Message-----
From: Kshama Bafna (Persistent Systems Private Ltd) [mailto:v-***@microsoft.com]
Sent: Friday, June 04, 2010 7:33 AM
To: WiX-***@lists.sourceforge.net
Subject: [WiX-users] Unable to add files in C:\Program Files (x86)\MyApp

Hi,

I have created an MSI using WIX and the installation is done correctly by the MSI. When I install my application to D:\MyApp, the application works fine and as expected it writes a few files in the same location. However, when I install the application at C:\Program Files (x86)\MyApp location, the application is unable to write the files in the installed location and it throws an exception 'Access Denied'. I do not get this exception when I run the application as 'Run as Administrator'.

Please let me know how can I get rid of this exception. Are there any permissions which could be set in the WIX file for the folder?

Thanks in advance,
Kshama
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


*** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail ***@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates).
Loading...