This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi All
Im trying to package a few applications in one executable.
My scenario is this. I have one main MSI File and two .exe's that need to be installed before the MSI is installed.
Here is the script I have made:
$urlWebViewLoc = ".\webview2.exe" $DeskDirectorInstaller = ".\client_desktop_app.msi" $dotnetLOC = ".\windowsdesktop-runtime-6.0.7-win-x64.exe"
Start-Process -wait -FilePath $urlWebViewLoc -ArgumentList "/silent /install" -Verb RunAs Start-Process -wait -FilePath $dotnetLOC -ArgumentList "/silent /install" -Verb RunAs
foreach($msiFiles in ($_msiFiles = Get-ChildItem $_Source -Recurse | Where{$.Extension -eq ".msi"} | Where-Object {!($_.psiscontainter)} | Select-Object -ExpandProperty FullName)) { msiexec /i $_msiFiles /passive }
When I run this directly via powershell the script works fine, the first two applications install then the msi installs
IE Express allows for a command line to be the application starter, so when I test this by running the following command prompt im getting an error message
PowerShell.exe -executionpolicy bypass -File "F:\deskdirector\Liberty Portal - iexpress Installer.ps1"
The error message im getting is this:
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
Does anyone know why this is happening? is there some trick to get this to work? or am I trying to do something that isnt really possible
Thanks
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...