Change Program Name and Shortcut Title during installation

坚强是说给别人听的谎言 提交于 2019-11-29 16:03:22

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:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!