This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- XML file changes failing under UAC
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 17, 2011
12:27 PM
XML file changes failing under UAC
In my InstallScript MSI installer, I have an XML file that I want to create the first time my program is installed. A couple of the elements have attributes that are set based on user input from the installation process. One of these is a path that is then used as the location where some files get installed. On subsequent installations, I need the XML file to be read in order to get the path info, but I don't need to update the XML file.
I've managed to implement all of the above in my InstallScript MSI project, except for the last part. Here's what I've done so far:
[LIST=1]
Create a System Search for each of the values I need to read from the XML File.
If any of those system searches aren't empty, I know the file exists and can skip the dialogs in the installer where the user supplies that info.
Add an XML file in the XML File Changes view to write the values to my file. Each of the attributes has something like [MY_PROPERTY1], [MY_PROPERTY2], etc. for its value.
In the InstallScript, save the user-supplied values to the [MY_PROPERTY] properties so they get substituted when writing the XML file.
Set the component for the XML file to have Permanent=Yes so that the XML file doesn't get deleted during uninstallation.
This all works great the first time I install. With UAC set to its default level, if I uninstall and then re-install, the System Searches work fine, but it chokes when trying to update the XML file. I get Windows error 2203, with the specific error code indicating "access denied." Even if I manually grant Full Control over the XML file and the folder containing it, I still get the error and the installation fails.
Can anyone think of a workaround for this problem, or maybe some other approach entirely that would solve this?
I'm running this all on Windows 7 x64 (RTM, not SP1) with InstallShield 11, Hotfix A.
I've managed to implement all of the above in my InstallScript MSI project, except for the last part. Here's what I've done so far:
[LIST=1]
This all works great the first time I install. With UAC set to its default level, if I uninstall and then re-install, the System Searches work fine, but it chokes when trying to update the XML file. I get Windows error 2203, with the specific error code indicating "access denied." Even if I manually grant Full Control over the XML file and the folder containing it, I still get the error and the installation fails.
Can anyone think of a workaround for this problem, or maybe some other approach entirely that would solve this?
I'm running this all on Windows 7 x64 (RTM, not SP1) with InstallShield 11, Hotfix A.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jun 06, 2011
08:56 AM
Updates:
After some more digging, a few more details...
[LIST=1]
I have several other XML files in the project that do almost identical things, but for which this error never occurs.
When running as a local admin on a system with UAC notification set to "never," I still get the error, but the error code indicates "file exists" instead of "access denied."
Anyone have any ideas for a solution?
After some more digging, a few more details...
[LIST=1]
Anyone have any ideas for a solution?