Sascha's point is that you can save this yourself if you really want to get it from the registry. ProductID might be the better property to change because it's been through any verification that might be done by ValidateProductID. However if you've already shipped the original it's too late, which is why upgrades need a sanity test before the original actually gets out the door.
My point is that if you don't want to do that, then a custom action can call MsiGetProductInfo. You don't pass parameters anyway. http://www.wixwiki.com/index.php?title=Simple_Custom_Action_Dll and you'll do a MsiGetProperty ("ProductCode" ...... ) and then MsiGetProductInfo for "ProductID" on that returned product code, then MsiSetProperty (handle.... "MYOLDPIDKEY" ....) to set the value into the MYOLDPIDKEY property, but there's no reason why you can't set PIDKEY. Since you're doing this on an upgrade of some kind you'd condition this CA call on the property in the Upgrade table. Phil Wilson -----Original Message----- From: Tim Musschoot [mailto:[email protected]] Sent: Thursday, November 05, 2009 11:05 AM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Read ProductID (PIDKEY) from registry It appears to be a property set by MSI in a location with a strange GUID. In brief: I cannot find logic between the application and the place MSI puts this parameter. I need to make a customaction call to the "MsiGetProductInfo" method in "msi.dll", passing some params. However, I've still not found how to call a dll method, passing parameters :-s -----Oorspronkelijk bericht----- Van: Sascha Beaumont [mailto:[email protected]] Verzonden: donderdag 5 november 2009 0:53 Aan: General discussion for Windows Installer XML toolset. Onderwerp: Re: [WiX-users] Read ProductID (PIDKEY) from registry Assuming that PIDKEY is just a property you're setting, you'll probably want to set the property to a default value (e.g. DEMO) and do a RegistrySearch to overwrite it if you can find an existing PIDKEY in the registry. <Property Id="PIDKEY" Admin="yes" Secure="yes" Value="DEMO"> <RegistrySearch Id="RegSearch_PIDKEY" Root="HKLM" Key="SOFTWARE\My Company\My App\1.0" Name="SerialNumber" Type="raw" /> </Property> Sascha On Wed, Nov 4, 2009 at 6:31 AM, Tim Musschoot <[email protected]> wrote: > Hello, > > I've found a way of introducing a product serial in the Installer. This key > is set in the registry at the default location (as arranged by MSI). Now I > want to read the key of a previous installation (at upgrade for example) > into the PIDKEY variable of my WIX script (this is not done automatically). > Can someone tell me how this can be arranged? > > TIA, > Tim > > > ---------------------------------------------------------------------------- -- > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/wix-users > ---------------------------------------------------------------------------- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users *** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail [email protected]. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates). ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users

