Change Program Name and Shortcut Title during installation
Asked Answered
D

2

2

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!

Daye answered 21/4, 2014 at 21:17 Comment(0)
M
1

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

Manvil answered 21/4, 2014 at 22:21 Comment(3)
I have a question about this part of your answer. 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. Are you saying that we can either do the transform and then distribute the transformed MSI to our users OR let the transform occur on the users side?Daye
A transform is just a bunch of database values. They can be merged permanently to an MSI, or applied at runtime. The latter is sort of the preferred approach in a technical sense - it is what the transform is for (to avoid touching the original msi directly), but merging works too if there is a good use case. Transforms are typically used by corporations to apply their custom changes for their own deployment, whilst leaving the original MSI unchanged.Bordelaise
Thanks glytzhkof! You have given me a very good path to follow. I have done installscript installations but MSI is new to me. I am excited to figure this out. Thanks again!Daye
A
1

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.

Autocatalysis answered 21/4, 2014 at 21:37 Comment(0)
M
1

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

Manvil answered 21/4, 2014 at 22:21 Comment(3)
I have a question about this part of your answer. 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. Are you saying that we can either do the transform and then distribute the transformed MSI to our users OR let the transform occur on the users side?Daye
A transform is just a bunch of database values. They can be merged permanently to an MSI, or applied at runtime. The latter is sort of the preferred approach in a technical sense - it is what the transform is for (to avoid touching the original msi directly), but merging works too if there is a good use case. Transforms are typically used by corporations to apply their custom changes for their own deployment, whilst leaving the original MSI unchanged.Bordelaise
Thanks glytzhkof! You have given me a very good path to follow. I have done installscript installations but MSI is new to me. I am excited to figure this out. Thanks again!Daye

© 2022 - 2024 — McMap. All rights reserved.