I know this thread is over a year old, but for those who find it via google,
the custom actions below fail with "Access Denied" under Vista when the user
does not have admin rights i.e. enters admin  credentials during install.
However it does work if you log in as Admin, or open a cmd prompt as admin.

On Tue, Apr 8, 2008 at 5:31 PM, Thomas Terhaar
<thomas.terh...@voicint.com>wrote:

>    I was struggling with the same issue and because I’m fairly new to WIX
> and MSI in general I was not able to find a ‘clean’ Solution.
>
> What I have so far is the following, I consider this a ‘Workaround’ :
>
>
>
>             <!-- Support Upgrading the Product -->
>
>             <Upgrade Id="{B0FB80ED-249E-4946-87A2-08A5BCA36E7E}">
>
>                   <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes
> " Property="NEWERVERSIONDETECTED" />
>
>                   <UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)"
> IncludeMinimum="yes"
>
>                                           IncludeMaximum="no" Property="
> OLDERVERSIONBEINGUPGRADED" />
>
>             </Upgrade>
>
>             <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />
>
>
>
>             <!-- Action to save and Restore the Config-File on reinstall
> -->
>
>             <!-- We're using CAQuietExec to prevent DOS-Boxes from popping
> up -->
>
>             <CustomAction Id="SetQtCmdLineCopy" Property="QtExecCmdLine"
> Value="&quot;[SystemFolder]cmd.exe&quot; /c copy &quot;
> [INSTALLDIR]MyApp.exe.config&quot; &quot;[INSTALLDIR]config.bak&quot;" />
>
>             <CustomAction Id="QtCmdCopy" BinaryKey="WixCA" DllEntry="
> CAQuietExec" Execute="immediate" />
>
>             <CustomAction Id="SetQtCmdLineRestore" Property="QtCmdRestore"
> Value="&quot;[SystemFolder]cmd.exe&quot; /c move /Y &quot;
> [INSTALLDIR]config.bak&quot; &quot;[INSTALLDIR]MyApp.exe.config&quot;" />
>
>             <CustomAction Id="QtCmdRestore" Execute="commit" BinaryKey="
> WixCA" DllEntry="CAQuietExec" />
>
>
>
>             <!-- These actions will run only for a major upgrade -->
>
>             <InstallExecuteSequence>
>
>                   <Custom Action="SetQtCmdLineCopy" After="
> InstallInitialize"> NOT (OLDERVERSIONBEINGUPGRADED = "")</Custom>
>
>                   <Custom Action="QtCmdCopy" After="SetQtCmdLineCopy">NOT
> (OLDERVERSIONBEINGUPGRADED = "")</Custom>
>
>                   <Custom Action="SetQtCmdLineRestore" Before="
> InstallFinalize">NOT (OLDERVERSIONBEINGUPGRADED = "")</Custom>
>
>                   <Custom Action="QtCmdRestore" After="SetQtCmdLineRestore
> ">NOT (OLDERVERSIONBEINGUPGRADED = "")</Custom>
>
>             </InstallExecuteSequence>
>
>
>
>
>
> This basically copies the File ‘MyApp.exe.config’ to ‘config.bak’ before
> the old Version is removed and after the new Version is installed, the File
> is moved back to it’s original Filename (thus the .bak File is removed)
>
>
>
> This works fairly well but I’m still wondering if there’s a more intuitive
> and cleaner approach to keep configuration settings when performing a major
> upgrade ?
>
> (No, I don’t want to use the Registry)
>
>
>
> Btw, I’m using WIX 3.0.3815.0
>
>
>
>
>
> Regards,
>
> Thomas
>
>
>
>
>
> *From:* wix-users-boun...@lists.sourceforge.net [mailto:
> wix-users-boun...@lists.sourceforge.net] *On Behalf Of *dB.
> *Sent:* Montag, 7. April 2008 01:00
> *To:* Bob Arnson
>
> *Cc:* wix-users@lists.sourceforge.net
> *Subject:* Re: [WiX-users] How do I preserve a configuration file on a
> majorupgrade?
>
>
>
> That doesn’t work. A component’s condition applies to installation. So once
> a component is installed, you can’t conditionally uninstall it when you
> remove the entire application, which happens during the major upgrade. Then
> you can choose not to re-install the component on a condition, but the
> configuration files will be removed by then.
>
>
>
> As Markus Kuehni wrote in his previous post, MSI keeps doing the “right
> thing”, which is to keep track of files and never leave anything behind. I
> think an extended file copy/move/delete would be a nice and simple WIX
> extension invoking the custom action and one could specify a condition on
> that.
>
>
>
> cheers
>
> -dB.
>
>
>
> *From:* Bob Arnson [mailto:b...@joyofsetup.com]
> *Sent:* Sunday, April 06, 2008 1:19 PM
> *To:* dB.
> *Cc:* wix-users@lists.sourceforge.net
> *Subject:* Re: [WiX-users] How do I preserve a configuration file on a
> major upgrade?
>
>
>
> dB. wrote:
>
> I tried, but using FileId or putting FileCopy under a File will delete my
> file on uninstall and not using FileId silently did absolutely nothing and
> didn’t show anything in the log. Basically I couldn’t get it to work. Maybe
> a bug?
>
>
> Hmm...Maybe another component with the right condition?
>
>  --
>
> sig://boB
>
> http://joyofsetup.com/
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Register now and save $200. Hurry, offer ends at 11:59 p.m.,
> Monday, April 7! Use priority code J8TLD2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


-- 
It's a wild world that we live in, you step to the vibe like a new
found religion, take your position, compile your vision, futurism,
algorithm has risen up!                                pfm - the western
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to