----- Original message -----
From: "Curtis Jewell" <swords...@csjewell.fastmail.us>
To: "General discussion for Windows Installer XML toolset."
<wix-users@lists.sourceforge.net>
Date: Mon, 29 Mar 2010 19:15:11 -0600
Subject: Re: [WiX-users] Save and reuse previous InstallDir

OK. Let's make sure I'm doing part 2 right.

I'll deal with HKLM/HKCU issues, and part 1a (the app does not write to
the registry at all - this is an app that comes from the Unix world, so
I provided a default directory in past .msi's) once this is correct.

<!-- Assume the other boilerplate and stuff - I've written my own perl
program that generates a lot of it. -->

    <!-- The next line will be replaced with a correct upgrade code.
    Just assume it's correct. -->
    <Upgrade Id='[% dist.msi_upgrade_code %]'>
        <!-- two other upgrade entries here -->
        <UpgradeVersion
          Minimum='5.0.0'
          IncludeMinimum='yes'
          Maximum='5.12.0'
          IncludeMaximum='no'
          Language='1033'
          Property='OLDERVERSIONBEINGUPGRADED' />
    </Upgrade>

    <Property Id="UpgradeDir">
        <RegistrySearch Id="RS_InstallDir" Root="HKLM"
        
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
        Name="InstallLocation" Type="raw" />
    </Property>
    <Property Id='INSTALLDIR'>C:\strawberry\</Property>

    <CustomAction Id="CA_GetARPInstallLoc" Property="INSTALLDIR"
    Value="[UpgradeDir]"  Execute="immediate"/>

    <InstallUISequence>
        <!-- QUESTION: Is this the correct point to do it? -->
        <Custom Action="CA_GetARPInstallLoc" Before="CostInitialize">
            OLDERVERSIONBEINGUPGRADED AND UpgradeDir
        </Custom>
    </InstallUISequence>


(I'm assuming that I have to do the CA somewhere in the middle of the
InstallUISequence.)

--Curtis

On Mon, 29 Mar 2010 17:41 -0400, "Wilson, Phil"
<phil.wil...@invensys.com> wrote:
> 1 a) You'd do a component search for a component guid that is in the same
> directory.
> 1 b) The app might write that info somewhere in the registry. 
> 
> 2. You don't need to. If you’re upgrading then you condition the (type
> 51?) custom action that sets the install directory based on whether you
> found a previous version. You do the search to a scratch property, then
> use that to set the install directory if OLDERVERSIONBEINGUPGRADED. 
> 
> Phil Wilson 
 
--
Curtis Jewell
swords...@csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and
pictures in HTML mail]

--
Curtis Jewell
swords...@csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in 
HTML mail]


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to