How do I create a MSI that can accept parameters?

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
jasonrutherford
Posts: 5
Last visit: Tue Feb 14, 2023 7:50 pm

How do I create a MSI that can accept parameters?

Post by jasonrutherford »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowerShell Studio 2021, 5.8.188
Operating system: Windows 10 20H2
PowerShell version(s): 5.1

*** Please add details and screenshots as needed below. ***

I have a PowerShell script that accepts parameters. I included it as a file in the "Files and Folders" section of the Installer. But, how do I generate an MSI that can accept arguments so I can pass the parameters? For example, if I have the parameter "[switch]$CreateFile" in my PowerShell script, can I simply run "msiexec.exe /i installer.msi -CreateFile"? How do I define what I need?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: How do I create a MSI that can accept parameters?

Post by Alexander Riedel »

That is not really how MSI files or installers work. An MSI file is for installing/uninstalling an application on a computer. It is not intended to pass parameters to that application.
Maybe you can elaborate a little bit more what you are trying to do.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
jasonrutherford
Posts: 5
Last visit: Tue Feb 14, 2023 7:50 pm

Re: How do I create a MSI that can accept parameters?

Post by jasonrutherford »

Thanks for the reply. I mean properties I suppose. Like, you can typically run a MSI with "/qn" for quiet, no UI. or ALLUSERS to install for all users. My example in the original post shows what I need to do.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: How do I create a MSI that can accept parameters?

Post by Alexander Riedel »

The command line options for MsiExec are documented on the Microsoft web site:
https://docs.microsoft.com/en-us/window ... ds/msiexec
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 2 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.