product search using product code?

13 messages Options
Embed this post
Permalink
dmcweeney

product search using product code?

Reply Threaded More More options
Print post
Permalink
Hi,

I'm in the process of moving 4 installers to Wix from Wise and trying to fix up some problems that were made in the Wise edited installers as regards product codes, upgrade codes etc.

One basic question I have is it possible to search if a product is installed if you know the product code. If so how? I want to put in some logic that will force a manual remove of existing install before doing new install of Wix built installers. I also want to check if product A is installed, then product B cannot be and visa versa. These existing products do not create any registry entries.

Also it is good practise or recommended to create registry entries for tracking if your product is installed - I know if I had some in the previous products I could do a registry search.

Thanks

        Donal


dmcweeney

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
Actually is it safe to use the following registry key to determine if an app is installed:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<ProductGuid>

Thanks

Donal
Alexander Shevchuk

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by dmcweeney
You can use Installer.ProductState (http://msdn2.microsoft.com/en-us/library/aa369463(VS.85).aspx) or MsiQueryProductState (http://msdn2.microsoft.com/en-us/library/aa370363(VS.85).aspx) to determine if product is installed and if installed - is it installed per-machine or per-user.

Alex


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of dmcweeney
Sent: Wednesday, March 26, 2008 10:00 AM
To: [hidden email]
Subject: [WiX-users] product search using product code?


Hi,

I'm in the process of moving 4 installers to Wix from Wise and trying to fix
up some problems that were made in the Wise edited installers as regards
product codes, upgrade codes etc.

One basic question I have is it possible to search if a product is installed
if you know the product code. If so how? I want to put in some logic that
will force a manual remove of existing install before doing new install of
Wix built installers. I also want to check if product A is installed, then
product B cannot be and visa versa. These existing products do not create
any registry entries.

Also it is good practise or recommended to create registry entries for
tracking if your product is installed - I know if I had some in the previous
products I could do a registry search.

Thanks

        Donal



--
View this message in context: http://www.nabble.com/product-search-using-product-code--tp16306215p16306215.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Wilson, Phil

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by dmcweeney
Can you use the upgrade mechanism to search for that product's UpgradeCode? Within a version range if needed? You'd mark it to "detect  only" and set a property you can check for.  Or perhaps the problems you're describing mean that this wouldn't work for some reason.

Phil Wilson


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of dmcweeney
Sent: Wednesday, March 26, 2008 10:00 AM
To: [hidden email]
Subject: [WiX-users] product search using product code?


Hi,

I'm in the process of moving 4 installers to Wix from Wise and trying to fix
up some problems that were made in the Wise edited installers as regards
product codes, upgrade codes etc.

One basic question I have is it possible to search if a product is installed
if you know the product code. If so how? I want to put in some logic that
will force a manual remove of existing install before doing new install of
Wix built installers. I also want to check if product A is installed, then
product B cannot be and visa versa. These existing products do not create
any registry entries.

Also it is good practise or recommended to create registry entries for
tracking if your product is installed - I know if I had some in the previous
products I could do a registry search.

Thanks

        Donal



--
View this message in context: http://www.nabble.com/product-search-using-product-code--tp16306215p16306215.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
dmcweeney

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alexander Shevchuk
Hi Alex,

Thanks for the quick response.
My guess is I would have to write a dll to implement this custom action? ;-(

It was installed per machine. The problem I am trying to get around is that the 4 kits - 2 x x86 and 2 x x64 share the same product code! (I know I know, I inherited it) and that is what I am trying to fix.

Thanks

        Donal
dmcweeney

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wilson, Phil
I could use the upgrade mechanism alright and that would work, however I want to assign neww product codes to the various kits, thus the reason for asking.

Sound

Donal
Bob Arnson-6

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
dmcweeney wrote:
> I could use the upgrade mechanism alright and that would work, however I want
> to assign neww product codes to the various kits, thus the reason for
> asking.
>  

You can search for multiple, arbitrary upgrade codes. They don't have to
match the upgrade code of the package being installed.

--
sig://boB
http://joyofsetup.com/



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Wilson, Phil

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by dmcweeney
But that's irrelevant. You're looking for UpgradeCodes of other installed products, and that's got nothing to do with new ProductCodes you want to assign to your setups.

Phil Wilson


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of dmcweeney
Sent: Thursday, March 27, 2008 4:27 AM
To: [hidden email]
Subject: Re: [WiX-users] product search using product code?


I could use the upgrade mechanism alright and that would work, however I want
to assign neww product codes to the various kits, thus the reason for
asking.

Sound

Donal
--
View this message in context: http://www.nabble.com/product-search-using-product-code--tp16306215p16324309.html
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
dmcweeney

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
I've just realised this - I was under the impression that the upgrade code with directly linked to the product code.

Thanks

Donal
Bob Arnson-6

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bob Arnson-6
Donal McWeeney wrote:
> Thanks for the answer. After understanding the upgrade table a bit more
> I realised that the previously authored msis were installed per-user and
> we need to do it per-machine, and the FindRelatedProducts does not
> search across context.
>  

It doesn't do that because it's frequently not possible. For example,
even an admin user wouldn't be able to peek into the per-user registry
of a user whose profile isn't loaded (e.g., roaming profiles). I'd
suggest another approach, like using RegistrySearch or FileSearch to
look in well-known locations. (That assumes you didn't have the previous
install going into per-user directories like LocalAppData.)

Then if FindRelatedProducts doesn't find anything, you can throw up a
dialog telling the user to uninstall manually.

--
sig://boB
http://joyofsetup.com/



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Mike Dimmick-2

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
Surely the installation state of a package shouldn't roam with the profile?
HKCU\Software\Classes doesn't (on XP it's UsrClass.dat in
%USERPROFILE%\Local Settings\Application Data\Microsoft\Windows, on Vista
that moves to AppData\Local\Microsoft\Windows). And the files are installed
to the local machine's disks - a given installation won't necessarily be in
the same location on two different systems.

I don't think it does roam - all the data is under
HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-USER
S-SID, whereas for All Users installs, it's under S-1-5-18. (Note: as
always, this is an implementation detail and shouldn't be relied on.)

It doesn't matter, though. All you need to know is that Windows Installer
treats the All Users store and each user's store as separate, and will
search only the user's store, if ALLUSERS is not present, or only the All
Users store, if ALLUSERS=1.

--
Mike Dimmick

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Bob Arnson
Sent: 29 March 2008 20:16
To: Donal McWeeney
Cc: [hidden email]
Subject: Re: [WiX-users] product search using product code?

It doesn't do that because it's frequently not possible. For example,
even an admin user wouldn't be able to peek into the per-user registry
of a user whose profile isn't loaded (e.g., roaming profiles).


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Bob Arnson-6

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
Mike Dimmick wrote:
> Surely the installation state of a package shouldn't roam with the profile?
>  

No but the likelihood of being able to uninstall without the user's
profile loaded is pretty low (e.g., HKCU keys). Safe -v- sorry, I think.

--
sig://boB
http://joyofsetup.com/



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
dmcweeney

Re: product search using product code?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bob Arnson-6
Doing a registry search on

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{old-product-code-guid}

is picking up if the old product is installed and I know that this was installed per-user so I can abort the install based on that.

Thanks again for the help

Donal