Hi Rob,

I think over my scenario and clarify it that I want my App should be installed 
with the registry, which has the path information (PathA) in it. So that when 
install a higher version (version 2) in another path (PathB), even they have 
same UpgradeCode, the previous version (version1) should not be upgraded (no 
Remove Action, no CustomAction). And the higher version is only treated as new 
install.

However, if I define the RegistryKey and RegistrySearch as my previous email, 
the Property "INSTALLDIR" will be always true, since it is all for the current 
install, not search previus install.

And when I check the Registry Editor, I only find the current Registry:
ViewPointUpgrade, value:PathB

There is no previous registry. So the RegistrySearch will always be true.

As I imagine, all the installation should be in the registry. And the property 
"INSTALLDIR" will do the registrysearch for all installed version.

How to realize it?

Regards,


Chunyan

-----Ursprüngliche Nachricht-----
Von: Jiang, Chunyan (GE Healthcare) 
Gesendet: Freitag, 23. Oktober 2009 10:39
An: General discussion for Windows Installer XML toolset.
Betreff: Re: [WiX-users] Upgrade and new install

Hi Rob,

You are right. I have been in the pain for long time. But I have no charge of 
this CustomAction. I only know this CustomAction should be run only in the 
upgrade. And I have to make it work. :(

I have modified the Registry element and give the condition to the custom as 
bellow:

    <Property Id="INSTALLDIR">
      <RegistrySearch Id='ViewPointRegistry' Type='raw'
        Root='HKCU' Key='Software\Microsoft\ViewPointUpgrade' Name='InstallDir' 
/>
    </Property>

    <DirectoryRef Id="APPLICATIONFOLDER">
      <Component Id="RegistryForUpgrade" 
Guid="D555488C-C8E7-44eb-91EC-3750602A7599">
        <RegistryKey Id='ViewPointInstallDir' Root='HKCU' 
Key='Software\Microsoft\ViewPointUpgrade' Action='createAndRemoveOnUninstall' >
          <RegistryValue Name='InstallDir' Type='string' 
Value='[APPLICATIONFOLDER]' />
        </RegistryKey>
      </Component>
    </DirectoryRef>

<Custom Action="UpgradeStopServices1" Before="InstallFiles">PREVIOUSFOUND AND 
INSTALLDIR</Custom>

The the upgrade is defined in the beginning of the wxs:
    <Upgrade Id="8517ae9a-667d-4bd3-9cea-4323be6d7040">
      <UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND" 
Minimum="5.0.0.0" IncludeMinimum="yes" Maximum="8.0.0.0" IncludeMaximum="no" />
    </Upgrade>

However, when I run the upgrade, install version 2 in PathA, where the version 
1 installed, CustomAction is still not called. It causes the problem for later 
function.

Is there something wrong in Property define, or in the condition for 
CustomAction?


Regards,

Chunyan

-----Ursprüngliche Nachricht-----
Von: Rob Mensching [mailto:r...@robmensching.com]
Gesendet: Donnerstag, 22. Oktober 2009 17:38
An: General discussion for Windows Installer XML toolset.
Betreff: Re: [WiX-users] Upgrade and new install

1. Personally, I would highly suggest you change your application so this 
CustomAction is unnecessary. You are in for a world of pain in the long run.
<smile/>
2. The Registry element has been deprecated in WiX v3. The warning tells you 
exactly what to do.

3. You'll have to condition your CustomAction in your first version of your MSI 
to not run on upgrade in the cases you are trying to avoid. If you have already 
shipped the first version of the MSI then you probably have to release a patch 
to that version to add the condition. After the patch is applied then you can 
try the upgrade.

4. See #1. <smile/>


On Thu, Oct 22, 2009 at 6:51 AM, Jiang, Chunyan (GE Healthcare) < 
chunyan.ji...@ge.com> wrote:

> Although there is Warning message on compile. From the verbose log I 
> got to know that the Custom Action will not be called when install 
> version 2 to PathB.
>
> Howver, there is Remove Action trying to remove files from PathA for 
> version 1 install during installing version 2 to PathB. And Install 
> Validate also checks the files in PathA.
>
> How can I prevent the Remove Action performing on Version 1 in PathA, 
> when install Version 2 in PathB. Should I set the condition 
> "INSTALLDIR" to somewhere, like I did for custom action?
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Jiang, Chunyan (GE Healthcare)
> Gesendet: Donnerstag, 22. Oktober 2009 13:19
> An: General discussion for Windows Installer XML toolset.
> Betreff: Re: [WiX-users] Upgrade and new install
>
> When I searched in Google, I found some one has the same problem as 
> me. And the suggested solution is to define a property using 
> RegistrySearch. And also define a registry with the install path 
> [APPLICATIONFOLDER]. So that the upgrade will only happen when the registry 
> with path found.
>
> I tried it as:
>
>    <Property Id="INSTALLDIR">
>       <RegistrySearch Id='ViewPointRegistry' Type='raw'
>        Root='HKCU' Key='Software\Microsoft\ViewPointUpgrade'
> Name='InstallDir' />
>    </Property>
>
>    <DirectoryRef Id="APPLICATIONFOLDER">
>      <Component Id="RegistryForUpgrade"
> Guid="D555488C-C8E7-44eb-91EC-3750602A7599">
>        <Registry Id='ViewPointInstallDir' Root='HKCU'
> Key='Software\Microsoft\ViewPointUpgrade'
>      Name='InstallDir' Action='write' Type='string'
> Value='[APPLICATIONFOLDER]' />
>      </Component>
>    </DirectoryRef>
>
> And call custom action as:
>
>      <Custom Action="UpgradeStopServices1"
> Before="InstallFiles">PREVIOUSFOUND AND INSTALLDIR</Custom>
>
> But I got warning when I compile it:
>
>  warning CNDL1080: The Registry element has been deprecated.  Please 
> use one of the new elements which replaces its functionality:
> RegistryKey for creating registry keys, RegistryValue for writing 
> registry values, RemoveRegistryKey for removing registry keys, and 
> RemoveRegistryValue for removing registry values.
>
> And when I install this version 2 installer msi, select PathB, the 
> problem is still there.
>
> Is there something wrong in the Registry define? How to change it?
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Jiang, Chunyan (GE Healthcare)
> Gesendet: Donnerstag, 22. Oktober 2009 09:04
> An: General discussion for Windows Installer XML toolset.
> Betreff: [WiX-users] Upgrade and new install
>
> Hi Wix-users,
>
> I have developed one upgradable installer with Wix3. As I understand 
> that main upgrade is same as new install. My scenario is that my 
> version
> 1 has been installed to PathA. And I have an upgraded version 2. If I 
> install version to to PathA, the old files are removed, the new files 
> are installed. Everything is fine. If I install version 2 to PathB, 
> the new files are copied to PathB, same as new install. It sounds good.
>
> However, there are custom actions in my installer, named MyCA. MyCA 
> should be called only by upgrade. So if version 2 installed to PathA, 
> MyCA in PathA will be called. It is fine. But if version 2 is 
> installed in PathB, MyCA in PathA will still be called. It causes some 
> problem for PathB install.
>
> How can I make a condition to MyCA, so that it will only be called 
> when the upgraded version installed in it's path? If version 2 is 
> installed in PathB, discard MyCA in PathA, do it same as new install.
>
>
> Best regards
>
> Chunyan
>
> ----------------------------------------------------------------------
> -------- Come build with us! The BlackBerry(R) Developer Conference in 
> SF, CA is the only developer event you need to attend this year.
> Jumpstart your developing skills, take BlackBerry mobile applications 
> to market and stay ahead of the curve. Join us from November 9 - 12, 
> 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ----------------------------------------------------------------------
> -------- Come build with us! The BlackBerry(R) Developer Conference in 
> SF, CA is the only developer event you need to attend this year.
> Jumpstart your developing skills, take BlackBerry mobile applications 
> to market and stay ahead of the curve. Join us from November 9 - 12, 
> 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ----------------------------------------------------------------------
> -------- Come build with us! The BlackBerry(R) Developer Conference in 
> SF, CA is the only developer event you need to attend this year.
> Jumpstart your developing skills, take BlackBerry mobile applications 
> to market and stay ahead of the curve. Join us from November 9 - 12, 
> 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


--
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the 
only developer event you need to attend this year. Jumpstart your developing 
skills, take BlackBerry mobile applications to market and stay ahead of the 
curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the 
only developer event you need to attend this year. Jumpstart your developing 
skills, take BlackBerry mobile applications to market and stay ahead of the 
curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to