Repository navigation
Description
Relevant area(s)
- WinGet CLI
Description of the new feature / enhancement
Some installers require or support a configuration / answer file to drive a silent or customized installation — content that can't always be expressed as command-line switches. Examples raised over the life of this issue:
- MSI transform files (
.mst) — e.g. licensed FortiClient requires an MST to install correctly - Setup Factory response files (
.rsp/ config) - Inno Setup / InstallShield answer files (
.iss) - Oracle client response files (
.rsp)
Today a user can only influence the installer command line via --override (replaces the entire argument string) or --custom (appends switches). For switch-based installers this technically allows referencing a file — e.g. winget install <pkg> --override "TRANSFORMS=C:\path\file.mst /qn" — but:
- It requires the user to know the exact vendor-specific switch syntax.
- There's no first-class, discoverable experience.
- It doesn't help installers that expect a config file staged at a known path rather than referenced by a switch.
Proposed scope (intentionally narrow): add a new install-time argument that lets the person running winget install point to a local configuration file they already have, which winget passes through to the underlying installer. The configuration file is supplied by the customer at install time — it is not stored in the winget-pkgs manifest repository. This keeps arbitrary (and potentially sensitive or attacker-controllable) configuration content out of the community repo and puts control in the hands of the installing user or organization.
Proposed technical implementation details
- New argument on
winget install(and likelywinget upgrade), e.g.--config-file <path>— naming TBD; must not collide withwinget configure/ DSC "configuration" terminology. - winget validates the path exists and is readable, then makes it available to the installer via one of:
- Switch substitution — the manifest declares how the file path maps to the installer's switch (e.g.
TRANSFORMS=<file>for MSI) and winget substitutes the user-provided path. - File staging — winget places the file where the installer expects it.
- Switch substitution — the manifest declares how the file path maps to the installer's switch (e.g.
- The manifest may optionally declare whether a package supports or requires a configuration file, so winget can prompt or error clearly when one is needed but not provided.
- Define interaction with existing
--override/--custom(precedence / mutual exclusivity).
Out of scope / non-goals:
- Storing configuration file contents in
winget-pkgs. - Generating vendor config files from manifest data (the earlier "Design A" alternative — not being pursued here).
Open questions:
- Argument name, to avoid confusion with WinGet Configuration (DSC).
- Should winget hash/validate the file? It's user-provided, so the trust model differs from a downloaded installer.
- Per-installer-type support matrix — MSI
TRANSFORMSis the clearest first target.
Updated with GitHub Copilot.
Activity
jantari commentedon May 19, 2020
config files are useful and sometimes needed for:
.iss).iss).mst).rsp)Since the manifests are YAML, inline files through a syntax like:
should be easy. The question is whether it's practical for long files and whether it's the right approach - maybe external files make more sense.
Because these file sometimes contain settings for highly subjective things like e.g. localization,
it would be super duper amazing if we could JINJA2 them with defaults. Think about this:
and then I install that package with a command like:
and I've customized the install language through a jinja2 replace in the
setup.iss.The
{{ LANG | 1031 }}expression means that ifLANGis not defined, it defaults to 1031 (which i believe is german or english, can't remember)This idea is probably silly and far from a spec - but the possibility to do something like this would be super! This would also allow one to choose a custom install directory which I believe was another open issue
ethanbergstrom commentedon May 20, 2020
Quite a few installers require input parameters via silent installation - MSIs even support this natively. Manifests should definitely be able to handle taking in parameters (optional or required) for silent installation and pass them to the executable or MSI/MSIX.
denelon commentedon Sep 2, 2020
I'd like a list of the top packages that actually require a config file for silent installation, not just parameters that need to be passed. It looks like IntelliJ falls into this category.
It would also help to know of a few specific packages that optionally take a config file. It looks like Microsoft SQL Server falls into this category.
I'm sure individuals would want to customize their configuration file in most cases. I'm thinking through how we could support a "default" configuration file in the community repository, and then a trivial mechanism to supply a different config file specific to the desired end state.
This could have implications on how "export/import" would behave as well as other scripted install scenarios.
mimi89999 commentedon Dec 7, 2020
IntelliJ does not require a config file anymore. Are there other packages that require it?
SpecterShell commentedon Feb 18, 2022
Installers built by Setup Factory may need a config file for silent install:
https://www.indigorose.com/webhelp/suf9/Program_Reference/Command_Line_Options.htm
(
/Tis the path of temp files, not the path of program files)Softwares from Stardock (Fences, Start11, Start10, etc.) are using this kind of installer.
denelon commentedon Feb 18, 2022
Thanks for concrete examples Charlie Chen (@SpecterShell).
jantari commentedon Dec 27, 2023
Demitrius Nelon (@denelon)
The licensed/paid version of FortiClient is an MSI installer that requires an MST transforms file in order to be installed (silently or non-silently) in order to connect to the correct management tenant and obtain its license from there. There is also a freely available version of FortiClient VPN to download, but it has fewer features and most corporate Fortinet customers will need to deploy the licensed version. The custom installer and MST file for this version of FortiClient is downloaded from the management platform, so basically every Fortinet customer gets a custom-built download. Because of this, this is a kind of software companies would distribute from their own internal winget repositories and not from the public winget-pkgs but it doesn't matter. There is more software like this - licensed and downloaded from some portal behind a login, and this software often uses MST for license or tenant registration information.
Microsoft Office 20xx Perpetual and Microsoft M365 Apps are installed by the Office Deployment Tool and the
/configure <XML-CONFIG-FILE.xml>parameter. The XML config file is a required argument and it must be a path pointing to a readable file (readable to the Office Deployment Tool and the user account that runs it).AutoDesk DWG TrueView requires an
.inifile and parameters such as:Setup.exe /W /q /I DWGTrueView_2021_English_64bit_dlm\setup.ini /language en-usto install silently.Janitza GridVis which is an IoT/industrial control system software that can either install in a standalone/single-client mode or a central-server mode with WebGUI and all, and it is an "install4j" setup that requires a
response.varfileanswer-file and parameters like:setup.exe -varfile "response.varfile" -qto install silently.The Oracle Instant Client requires a
.rspresponse-file and parameters likesetup.exe -silent -nowait -responseFile answerfile.rspfor silent installation.In order to install a licensed version of PDF XChange Editor Plus you want to pass it a
.xcvaultlicense file via the install parameterKEYFILE=<PATH>. Technically there is also the option to use theKEYDATA=parameter and pass the license encoded as Base64 but that is very unreadable, you risk hitting Windows' 1024 character command-line length limit and it's also not preferable for other license management reasons. See: https://help.pdf-xchange.com/sysadmin/ and https://help.pdf-xchange.com/pdfxe10/index.html?switches-for-msi-installers_edpub.html.There is another piece of software, not publicly available and rather specific to the industry my employer is in, that has an installer made with the "Qt Installer Framework". This software/framework requires a rather complex
.qsfile written in JavaScript and using callbacks to navigate a silent installation: https://doc.qt.io/qtinstallerframework/noninteractive.htmlUltraVNC, while already available on winget-pkgs also requires a
/loadinf="config.inf"parameter to install it with a desirable configuration. The defaults, chosen when no config-file is provided like right now, are only good for some limited usecases.Microsoft wants us to deploy the new Microsoft Teams using a
teamsbootstrapper.exeexe and a.msixfile. One is the installer, one is the application package. This isn't really a "config file" but it is an additional file that has to be bundled in order for the install to "work" (well, in reality it doesn't work at all anyway but that's not your/wingets problem, that's just Microsoft being Microsoft: https://github.com/MicrosoftDocs/OfficeDocs-SkypeForBusiness/issues/10542) - in theory, if this bootstrapper did work, then it would also require the bundled .msix file.Additionally, any number of in-house developed apps may require or optionally accept MST or similar response/answer/transform/config files during installation. Even many apps that are already in the winget-pkgs repo today, such as Mozilla Firefox, can optionally take MST transforms and an individual or corporate user of winget may want to distribute a "customized" version of any such ordinary software like Firefox through their winget package repository. This may be achieved a number of ways, in the case of Firefox specifically there's GPOs and Intune policies too, but MST files are another option and for some software maybe the only option. Also, some software may be deployed before a computer is joined to an MDM such as Intune or an Active Directory domain (such that GPOs would take effect) so pre-customizing it right during the install is the safest option. For example, we currently deploy the benign software "neovim", which is already available in winget-pkgs, with a custom MST transforms file that tells it to NOT put a shortcut on the desktop. There is no parameter or other way to prevent the Neovim MSI installer from creating a desktop shortcut, but an MST works.
All of that being said, could we not solve this already with ZIP files and nested installers? The ZIP file would just contain the MST/config/answer file we need for the setup to run and the parameter would be passed to the nested installer? I have not tried this, but it seems like it should work - but then again this issue is still open?
I hope I was able to help and some of these examples are useful.
jantari commentedon Dec 28, 2023
I just tried deploying a licensed FortiClient (MSI + MST) using the following manifest (excerpt):
and it worked flawlessly. Demitrius Nelon (@denelon) Would you say ZIPs + NestedInstallers are a good way to achieve multi-file installs like what is asked here? Or would you consider it unsupported and we shouldn't rely on it working?
denelon commentedon Mar 6, 2024
I wouldn't rely on it working since portable packages get different treatment in terms of how the path is hooked up. With administrator or Dev Mode enabled, we have a path available, but with user install and Dev Mode disabled, we end up with path cramming.
jantari commentedon Mar 15, 2024
But InstallerType portable is not the same as InstallerType zip:
winget-cli/schemas/JSON/manifests/v1.7.0/manifest.installer.1.7.0.json
Lines 55 to 69 in 2fece93
Unless I'm misunderstanding, the behavior and handling of portable packages should not apply to ZIP + NestedInstaller packages.
jantari commentedon Jun 9, 2024
Any new developments or comments on this?