Change Program Name and Shortcut Title during inst

2019-07-16 14:46发布

I have a Basic MSI Install with Install Shield 2013 and we have about 20 different affiliate releases. Really the only difference between these releases is the Program Name and the shortcut that is installed on the desktop. We are trying to have one release build instead of building the same program over and over with these minor differences.

I have been trying to find a way to change those items at install time but have not been successful. Has anyone out there done this before or have any suggestions of where I could find some information about things like this.

My goal for the user experience during install time would be the following:

  • Generic Welcome Screen Appears
  • User is prompted for an affiliate code
  • MSI changes the program name and shortcut information to the title assigned to that code

Thanks in advance to everyone!

2条回答
smile是对你的礼貌
2楼-- · 2019-07-16 14:59

The Shortcut tables doesn't allow for formatted shortcut names. I know how to implement variation points three ways:

1) Build Time 2) Install Time 3) Runtime

You're question indicates you want to go from build time to install time. It's possible to do this using custom actions that manipulate the Shortcut table using temporary rows.

The way I'd do it is have a custom table with schema Affiliate Code [PK] Branding

The custom action would get the prompted or passed value and find the row in the table for branding data. Then emit the data into the shortcut table and let MSI handle the rest.

查看更多
何必那么认真
3楼-- · 2019-07-16 15:07

I think I would just use a transform for this, since the changes are so minimal. Transforms are used for adding multi-language support to an MSI, so this should certainly be easier with just a couple of changes to the parent database.

You create your own setup.exe launcher (there are many templates available - I think even Installshield has one you can use). The setup.exe asks for the affiliate code and then applies the appropriate transform (or the default one) and kicks off the install. This would be the recommended approach.

You can even merge the transforms as a build step and spit out as many "transformed" MSI files as you need. Then there is less "clunk" in the launching, but it sounds like you need to switch behavior based on the affiliate code, and then your setup.exe would be effective since it can contain the logic necessary to chose the transform to apply depending on the user input.

If you are not familiar with a transform, it is essentially like a little "transaction" or a database fragment that is applied to your MSI adding, replacing and / or updating rows with new data. You can create one via any MSI tool, including Orca from the Windows SDK.

Transforms are applied at the command line for msiexec.exe. Here is a sample command line with truncated paths for illustration. This is silent installation, with verbose log and two transforms applied (one is the language transform):

msiexec.exe /I "IsWiX.msi" /QN /L*V "C:\msilog.log" TRANSFORMS="C:\IsWix.mst;C:\1031.mst"

Here is a sample transform applied to a parent database: enter image description here

查看更多
登录 后发表回答