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:latest
Operating system:21h2
PowerShell version(s):
32-bit version of software?
*** Please add details and screenshots as needed below. ***
I want to install a separate MySecond.MSI that I do include in my first MSI file. Either the build fails, or the second MSI never launches. Thoughts?
Run MSI after MSI via Custom Script
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
-
- Posts: 24
- Last visit: Mon Feb 06, 2023 11:30 am
- Has voted: 1 time
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Run MSI after MSI via Custom Script
Run your installer with a log. That usually should give you a hint.
msiexec /i "C:\MyPackage\Example.msi" /L*V "C:\log\example.log"
You can do the same for your secondary installer to see if it gets even executed and fails or if it just never gets executed.
Most likely it fails because another installer is currently running.
msiexec /i "C:\MyPackage\Example.msi" /L*V "C:\log\example.log"
You can do the same for your secondary installer to see if it gets even executed and fails or if it just never gets executed.
Most likely it fails because another installer is currently running.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 24
- Last visit: Mon Feb 06, 2023 11:30 am
- Has voted: 1 time
Re: Run MSI after MSI via Custom Script
When I put quotes in, the build fails
error CNDL0104 : Not a valid source file; detail: 'C' is an unexpected token. Expecting white space. Line 80, position 264.
so whatever the character is after the first double quote, is the unexpected token.. If I run this
/i /quiet "C:\Utilities\MS1Number1Folder\Application Manager.msi" - fails to create MSI
/i /quiet C:\Utilities\MS1Number1Folder\Application Manager.msi - Creates the MSI , and launches MSIEXEC (like its waiting for args) after the first MSI goes through
I added in the logging, does not create log file in my C:\temp folder, even I remove the quotes
error CNDL0104 : Not a valid source file; detail: 'C' is an unexpected token. Expecting white space. Line 80, position 264.
so whatever the character is after the first double quote, is the unexpected token.. If I run this
/i /quiet "C:\Utilities\MS1Number1Folder\Application Manager.msi" - fails to create MSI
/i /quiet C:\Utilities\MS1Number1Folder\Application Manager.msi - Creates the MSI , and launches MSIEXEC (like its waiting for args) after the first MSI goes through
I added in the logging, does not create log file in my C:\temp folder, even I remove the quotes
-
- Posts: 24
- Last visit: Mon Feb 06, 2023 11:30 am
- Has voted: 1 time
Re: Run MSI after MSI via Custom Script
I also know the work around is to create a PS1 to call the MSI, but I feel like I shouldn't have to do that
Please note, I'm not experienced but know enough and your product is AMAZING
Please note, I'm not experienced but know enough and your product is AMAZING
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Run MSI after MSI via Custom Script
It's the Bermuda triangle of our MSI builder, the WiX Toolset and Windows Installer.
Try using single quotes instead of double quotes. The file for the WiX Toolset is XML and likely something does not get correctly encoded/decoded.
I will be looking into it from our end here.
In general, if you have to install two or more MSI files I personally would do it this way:
- Create a starter executable with some progress / activity indicators.
- Copy the MSI files needed from a network or online location as needed from that application.
- Check what needs to be installed and what not from that app.
- Install everything needed one by one, making sure no two instances of msiexec are running.
This gives you more control over what gets installed, you can check versions, runtimes, PowerShell version etc from that front end application.
You can add a check box to install with logging if your customer / client experiences problems.
Try using single quotes instead of double quotes. The file for the WiX Toolset is XML and likely something does not get correctly encoded/decoded.
I will be looking into it from our end here.
In general, if you have to install two or more MSI files I personally would do it this way:
- Create a starter executable with some progress / activity indicators.
- Copy the MSI files needed from a network or online location as needed from that application.
- Check what needs to be installed and what not from that app.
- Install everything needed one by one, making sure no two instances of msiexec are running.
This gives you more control over what gets installed, you can check versions, runtimes, PowerShell version etc from that front end application.
You can add a check box to install with logging if your customer / client experiences problems.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 24
- Last visit: Mon Feb 06, 2023 11:30 am
- Has voted: 1 time
Re: Run MSI after MSI via Custom Script
Thanks for looking into this!
I'm doing ok with using a PS1 to launch the second app which funny enough is my application starter/manager for my applications across business departments. Do you all do virtual consulting?
I'm doing ok with using a PS1 to launch the second app which funny enough is my application starter/manager for my applications across business departments. Do you all do virtual consulting?
-
- Posts: 24
- Last visit: Mon Feb 06, 2023 11:30 am
- Has voted: 1 time
Re: Run MSI after MSI via Custom Script
This is what's in my CA_InstallApplicationManager.PS1 for those looking to install an MSI that may already be installed, you can read more about the MSIEXEC install switches here
https://docs.microsoft.com/en-us/window ... nstallmode
This might not be best practice but here's where I am
I have two feature requests to add onto the backlog...
One click to Uninstall, Build All, Install - or like a CustomTool thats in the Build and Run section
Ability to hide the PowerShell CMD window. The command you run for MS1 ommits the -hidden parameter
https://docs.microsoft.com/en-us/window ... nstallmode
This might not be best practice but here's where I am
I have two feature requests to add onto the backlog...
One click to Uninstall, Build All, Install - or like a CustomTool thats in the Build and Run section
Ability to hide the PowerShell CMD window. The command you run for MS1 ommits the -hidden parameter
- #Get MSIVersion since Windows wont allow it easily
- function Get-MsiVersion
- {
- param (
- [parameter(Mandatory = $true)]
- [ValidateNotNullOrEmpty()]
- [System.IO.FileInfo]$MSIPATH
- )
- if (!(Test-Path $MSIPATH.FullName))
- {
- throw "File '{0}' does not exist" -f $MSIPATH.FullName
- }
- try
- {
- $WindowsInstaller = New-Object -com WindowsInstaller.Installer
- $Database = $WindowsInstaller.GetType().InvokeMember("OpenDatabase", "InvokeMethod", $Null, $WindowsInstaller, @($MSIPATH.FullName, 0))
- $Query = "SELECT Value FROM Property WHERE Property = 'ProductVersion'"
- $View = $database.GetType().InvokeMember("OpenView", "InvokeMethod", $Null, $Database, ($Query))
- $View.GetType().InvokeMember("Execute", "InvokeMethod", $Null, $View, $Null) | Out-Null
- $Record = $View.GetType().InvokeMember("Fetch", "InvokeMethod", $Null, $View, $Null)
- $Version = $Record.GetType().InvokeMember("StringData", "GetProperty", $Null, $Record, 1)
- return $Version
- }
- catch
- {
- throw "Failed to get MSI file version: {0}." -f $_
- }
- }
- #EndFunction
- $MSIPath = '.\Application Manager.msi'
- Write-Host "Installing Application Manager $(Get-MsiVersion -MSIPATH $MSIPath)"
- if (!(Test-Path 'C:\Utilities\Application Manager'))
- {
- & $MSIPath
- Write-Host "done..."
- }
- else
- {
- Get-Process -Name 'Application Manager' -ErrorAction SilentlyContinue | Foreach-Object { $_.CloseMainWindow() }
- $InstallerArgs = @(
- "/i"
- "`".\Application Manager.msi`""
- "REINSTALLMODE=oeau"
- "/quiet"
- )
- Start-Process -FilePath msiexec.exe -ArgumentList $InstallerArgs -Wait
- Write-Host "done..."
- }