how can I start software after installed silently using PowerShell? - windows

I have installed software using powershell command, for example 7zip:
Start-Process msiexec -ArgumentList '/I C:\Desktop\7z2106-x64.msi /quiet /passive /L*V "C:\Desktop\package.log"' -Wait -NoNewWindow
And then there are two problems:
How to check whether the software is successfully installed?
If installed successfully, How to start the software?
I need to solve the two problems with scripts instead of interactive interfaces. I haven't found a good solution. Can anyone help me? Thanks.

Related

Not getting any error log in Windows PowerShell while installing MSU

While I am trying to install MSU manually in the windows 2019 server, I am getting one error like
"The update is not applicable to your computer". Because some alternative KB has been installed already. So it's not allowed to install the MSU that I want to install. It's fine.
But when I am trying to install the same MSU through PowerShell by below mentioned PowerShell commend I am not getting any error log. I need a script to show the error log; if its any error. It has to skip this MSU installation. Experts please help me one this. I am looking forward to hear from you.
Start-Process -FilePath "$env:SystemRoot\System32\wusa.exe" -ArgumentList "C:\MicrosoftEdge_KB\windows10.0-kb4520062-x64.msu /quiet /norestart" -Wait

Error installing windows remote desktop app using powershell as per-device using -allusers option

I am having problems installing the msi for the windows remote desktop app using powershell as per-device.
From https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/windowsdesktop-admin
Per device installation only requires ALLUSERS=1 option.
This works msiexec.exe /I 'C:\ITS\RemoteDesktop_1.2.3213.0_x64.msi' /qn /l*v C:\ITS\RemoteDesktop119.log
This errors with error status: 1603 msiexec.exe /I 'C:\ITS\RemoteDesktop_1.2.3213.0_x64.msi' /qn ALLUSERS=1 /l*v C:\ITS\RemoteDesktop119.log
Just above error, Return value 3 there are some rubbish characters in the Public Desktop Path.
Error 1606. Could not access network location ΓÇ£C:\Users\Public\DesktopΓÇ¥\Desktop.
This was not an issue with the MSI rather a 3rd party app that was overwriting data in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Installing Debugging Tools for Windows from command line

I am trying to automate a Windows build in AWS Codebuild which require downloading Windows SDK with Debugging Tools for Windows installed.
I am able to install the Windows SDK using Visual Studio with some other files required.
powershell -c "Start-Process -FilePath 'vs_community.exe' -ArgumentList \"--quiet\",
\"--norestart\" , \"--add Microsoft.VisualStudio.Workload.Universal\",
\"--add Microsoft.VisualStudio.Workload.NativeDesktop\",
\"--add Microsoft.VisualStudio.Component.VC.ATLMFC\",
\"--add Microsoft.VisualStudio.Component.Windows10SDK.19041\",
\"--includeRecommended\" -Wait;"
The build requires Debugging Tools for Windows enabled in Windows SDK which is straightforward in UI installation. But since I want to automate this, I am looking for a command line option to install Debugging Tools for Windows in Windows 10 SDK.
I was able to install Debugging Tools for Windows via standalone windows sdk installer through command line as below:
powershell -c "Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?linkid=2120843' -OutFile winsdksetup.exe -UseBasicParsing ;"
winsdksetup.exe /features + /q /norestart
/features + selects all the features available in Windows SDK to install.

Running an installation program from Team City

Is it possible to execute a setup program, which requires user input, from TeamCity?
It is an MSI installer file and using all the defaults is just fine, I just need to run the installation program automatically.
Use msiexec /i foo.msi /quiet to avoid the installer prompting.
There are other possibly relevant options; see msiexec /?.

Silent install of vcredist_xxx.exe

I have successfully installed vcredist_x86.exe and vcredist_x64.exe on Windows Server 2008R2, 2012 and 2012R2 using:
start-process -FilePath "vcredist_x86.exe" -ArgumentList "/install /q /norestart" -Verb RunAs -wait
BUT
For some reason this does not work on 2008 (NOT R2), neither x86 or x64. I always get prompted. The file is being installed from a \share.
Help is much appriciated.
Thanks!
-wait parameter does not work with 2012 vcredist in W2008.

Resources