Build variants
One program, several setups. A product sold in Germany, France and Russia needs an installer for each country — only in its language, with its own services and server addresses — and all of them have to be tried on one computer. Build variants make them from one project, so a change is made once and goes into every setup.
When you need it
- Markets. A setup per country: its language only, its payment gateways, its servers, its legal texts.
- Editions. Lite and Pro, a trial and a full version, a build for one big customer.
- Channels. A setup for a reseller with its own name and support line.
Without variants you would keep three copies of the project, and a file added to one would be forgotten in the others. With variants there is one project: what all of them share is set once, and each variant has only what is its own.
The section is not on the left until you add it: Add a feature under Product. It stands before the files and the registry because the variants decide what goes where. A project without variants is one product, as before.
How they install
| Side by side | Each replaces another | |
|---|---|---|
| What they are | Separate products | One product in several kinds |
| Product code | Each variant has its own | Shared: the one in Version upgrades |
| On one computer | All of them at once: three entries in the list of programs, three folders | One at a time: installing FR over DE removes DE |
| For | Markets and editions; trying every variant on your own computer | A customer who moves from one market or edition to another |
What each variant has
| Field | What it is |
|---|---|
| Tag | A short name — DE, Pro, up to 16 Latin letters, digits, - and _. It is {Variant} in any field. |
| Name | What it is for people: Germany, the free edition. |
| Languages | The installer's languages in this variant, from the project's. One language: the installer speaks only it and asks nothing. None ticked: all of the project's. |
| Product code | Side by side only: its own code, so Windows sees a product of its own. Keep it from version to version. |
| File name | The setup file: {ProductName}-{Version}-{Variant} makes LedgerPro-5.2.0-DE.exe. |
| In the list of programs | Its name in Settings and Programs and Features: {ProductName} ({Variant}). |
| Folder | The name of its folder under Program Files\Publisher (or the user's Programs): {ProductName} {Variant}. |
| Own values | The values of Properties and variables as this variant gives them: a server's address, a gateway, a support line. An empty one is the project's. |
A new variant starts as a copy of the whole project: all files, all languages, a new code. Copy of the variant does the same from another variant, with the files and keys marked for it.
If the project has a Software tag, each variant side by side gets a tag id of its own, made from the project's and shown on its card, so asset tools count the variants as the products they are.
What goes in a variant
Files, shortcuts, registry keys and prerequisites have the variants they go in at the end of their line: in all, or the tags of the ones that have them. Click it to tick the variants:
- In every variant — the item goes everywhere, and a variant added later gets it too.
- Some variants — only those; a new variant doesn't get it until you tick it.
- In none — shown in the warning colour: it goes in no setup.
A folder rule in Files and folders takes everything it finds with it, so the banking services of the German variant are one folder marked DE.
Show the project as one variant
When the project has variants, Show appears at the top of the editor. Choose a variant, and Files and folders, Shortcuts, Registry and Prerequisites show the project as that variant has it: what isn't in it is paler. In every field {Variant} reads its tag, and own values read as that variant gives them. All variants shows everything.
Checks between variants
Each variant is checked as a product of its own, and then all of them against each other: what two of them share where Windows allows only one. The section lists those under Shared where they can't be, each with a fix as a button; the editor offers the fix and doesn't make it unasked.
| What is compared | Why one for two is a problem | The fix offered |
|---|---|---|
| The setup file's name | One build writes over the other | -{Variant} in the file name |
| The install folder | One overwrites the other's files; removing one breaks the other | {ProductName} {Variant} |
| The name in the list of programs | Three alike entries, hard to tell apart | {ProductName} ({Variant}) |
| The product code | Windows takes them for one product: the second replaces the first | New codes |
| A registry key | Their settings mix | \{Variant} at the end of the key |
| A shortcut | Only the last one installed stays | ({Variant}) in its name |
When variants replace each other, only the file name is compared: the rest is meant to be shared.
A registry key with {Variant} in its path is a key per variant — your program then has to read its own key. Give it the tag in a shortcut's arguments or in its settings file: --market {Variant}.
Building
Build makes every variant, one after another, into the build folder: LedgerPro-5.2.0-DE.exe, LedgerPro-5.2.0-FR.exe, LedgerPro-5.2.0-RU.exe. Each is built from the project as that variant: its languages, its code, its values, and only the files, shortcuts, keys and prerequisites marked for it.
Try them on your computer
With variants side by side, install all of them: Programs and Features lists each by its own name, each has its own folder, and each one's uninstall removes only itself. PowerShell shows them:
Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*,
HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
Where-Object DisplayName -like "Ledger Pro (*" |
Select-Object DisplayName, DisplayVersion, InstallLocation
In MSI
When Cobalt Installer builds MSI files, the variants map to its codes like this:
| How they install | UpgradeCode | ProductCode |
|---|---|---|
| Side by side | Each variant's own — its product code here | New for each version of each variant, made for you |
| Each replaces another | Shared — the project's product code | New for each variant and version, made for you |