I feel silly...

None of this was necessary.  Turns out that setting the ProductName property 
already takes care of updating the name in ARP.  HOWEVER - you have to set it 
in the InstallExecuteSequence.  I was just setting it in the UI phase.

Thanks anyway! It was a fun exercise... lol.



Matt Johnson MCPD, MCTS, MCSD, MCDBA
Director of Application Development
Time America, Inc.
ma...@timeamerica.com | www.timeamerica.com


-----Original Message-----
From: Matt Johnson [mailto:ma...@timeamerica.com] 
Sent: Monday, June 21, 2010 2:50 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Set package name dynamically

I just tried some manual testing before writing a full-blown CA.  It seems 
changing the summary info on the cached msi does nothing.  I can see the change 
when I examine the msi in Orca, but it does not change the product name in 
add/remove programs.

I found something else that seems more promising.  It appears that the name in 
ARP is the "Advertised" product name.  Now, I'm not using and advertised 
features in my product, but it looks like I can take advantage of this anyway.  
While I can't seem to find any way to update this directly from an MSI 
property,  I did find that I can change the regkey at 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\<id>\ProductName and it 
changes the corresponding name in ARP!  The <id> corresponds to the product 
code, but it's byteswapped in a few places (no biggie).

Using DTF, I can see my change corresponding to 
ProductInstallation.AdvertisedProductName, while the original name still exists 
in ProductInstallation.ProductName.  DTF has no way to set these properties, 
and I don't see any way in the MSI docs either, but it's simple enough to 
update that regkey at the end of my install.

Is this a safe approach?  Does that key perhaps only work for me because I'm on 
Windows 7, or do you think it will it work on older versions of Windows?  
Obviously, I need to do some testing.

Thanks,

Matt Johnson MCPD, MCTS, MCSD, MCDBA
Director of Application Development
Time America, Inc.
ma...@timeamerica.com | www.timeamerica.com


-----Original Message-----
From: Blair [mailto:os...@live.com] 
Sent: Monday, June 21, 2010 1:34 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Set package name dynamically

Code signing works putting the program in in the first place.

Yes, you could alter the MSI directly using the Summary Info APIs. That
should work.

-----Original Message-----
From: Matt Johnson [mailto:ma...@timeamerica.com] 
Sent: Monday, June 21, 2010 12:22 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Set package name dynamically

The ARPSYSTEMCOMPONENT route seems treacherous.  Can't I just modify the
summary information on the cached msi in c:\windows\installer?  The code
signing signature doesn't work from add/remove programs anyway, due to MSKB
929467.  The trick here would be to find out when the cached msi is written,
and what the filename is.  Then I could use MsiSummaryInfoSetProperty just
on the cached file, yes?


Matt Johnson MCPD, MCTS, MCSD, MCDBA
Director of Application Development
Time America, Inc.
ma...@timeamerica.com | www.timeamerica.com

-----Original Message-----
From: Blair [mailto:os...@live.com] 
Sent: Friday, June 18, 2010 9:34 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Set package name dynamically

The summary information stream is MSI metadata "outside" of the MSI SQL
database (but inside of the MSI file) and uses a different set of APIs to
access than the rest of the data in the file. Changing it would have to
occur before you start an installation transaction, and if you codesign your
MSIs to prove to your customers that no tampering has occurred, changing the
summary info stream will invalidate your signature (the system will treat it
as if it had never been signed, including the "scarier" UAC-related prompt
used with unsigned files vs. the one used with signed files).

The data in the registry related to display in ARP is used only for "legacy"
installations (those that are non-MSI based). The only way to, at runtime,
change that data is to use the ARPSYSTEMCOMPONENT property and then write an
entirely new "legacy" registry entry for ARP. However, there are downsides
to that: for one - you lose the Repair button in ARP.

A discussion on using that property, including some dangers and some
mitigations, can be found by checking the posts on this page:
http://blogs.msdn.com/b/heaths/archive/tags/arpsystemcomponent/. I recommend
reading the blogs in the order they were written, which would mean oldest
first (bottom of page?).

-----Original Message-----
From: Matt Johnson [mailto:ma...@timeamerica.com] 
Sent: Friday, June 18, 2010 5:46 PM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Set package name dynamically

Is there any way to set the packa...@description property dynamically?  It
does seem to accept bracket-style properties, but it only uses the values
that those properties are initialized to on startup.  If I change the value
during install, I still get the original value displayed in Add/Remove
Programs.

Basically, my application is cobranded with different names and I'm building
a generic installer.  I read the brand name from a license key in a custom
action before the first UI dialog.  I use that to decide what to set the
ProductName property to and what graphics to load in to the UI.

It works great, except I can't get the name in add/remove programs updated.
I tried changing the
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{guid}\DisplayName
value, but it seems to have no effect.

The docs say that that packa...@description ends up in the summary
information stream.  Is there a way to write to the summary information
stream dynamically at runtime? Or is this hardcoded into the MSI?  Perhaps
there's a way to write to the cached MSI that Add/Remove programs is looking
at?  I'm not sure where it's cached to.  Please help.

Thanks,

Matt Johnson MCPD, MCTS, MCSD, MCDBA
Director of Application Development
Time America, Inc.
ma...@timeamerica.com<mailto:ma...@timeamerica.com> |
www.timeamerica.com<http://www.timeamerica.com/>

----------------------------------------------------------------------------
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

----------------------------------------------------------------------------
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to