Not getting any error log in Windows PowerShell while installing MSU - windows

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

Related

how can I start software after installed silently using PowerShell?

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.

Why doesn't the Visual Studio 2017 Build Tools installer work?

I have Windows running in a VMware VM, to which I connect via SSH. I can run a Command Prompt or a PowerShell. I'm trying to follow the instructions to install Visual Studio 2017 Build Tools from a command line. I download the installer from https://aka.ms/vs/15/release/vs_buildtools.exe and name it vsbt2017.exe, the "installation channel" from https://aka.ms/vs/15/release/channel and name it vs2017.chman, and I create an empty directory for the installation at C:\vs2017.
When I try this command in Command Prompt, it does not return immediately, waits a few seconds, then returns. My install path remains empty. No error message is printed to the terminal. %ERRORLEVEL% is 1.
start /wait .\vsbt2017.exe --quiet --wait --norestart --nocache --installPath C:\vs2017 --channelUri C:\vs2017.chman --installChannelUri C:\vs2017.chman --add "Microsoft.VisualStudio.Workload.VCTools;includeRecommended"
When I try this command in PowerShell, I get the same results. The analog of this command works for me for VSBT 2019, so it's really puzzling why it doesn't work for 2017.
Start-Process -FilePath C:\vsbt2017.exe -ArgumentList "--quiet --wait --norestart --nocache --installPath C:\vs2017 --channelUri C:\vs2017.chman --installChannelUri C:\vs2017.chman --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended" -Wait -PassThru
If it makes a difference, I already have VSBT 2019 installed on this VM, but I've read in Microsoft's documentation that multiple versions can be installed simultaneously.
Almost two years ago, I asked a similar question about the 2019 Build Tools installer. This time, I need to install the 2017 Build Tools. The reason is that I need to figure out why someone else's installation of Visual Studio 2017 doesn't work, so I need to test with their version. "Just install Visual Studio 2019" is not an acceptable answer to this question.

Installing Visual Studio 2017 Community getting error when installing microsoft.visualstudio.AspNet45.features

The error is being caused by Visual Studio Installer 2017 trying to execute the command C:\WINDOWS\system32\dism.exe" /online /quiet /norestart /Enable-Feature /FeatureName:"netfx4extended-aspnet45" /All /logPath:"C:\Users\lgray\AppData\Local\Temp\dd_setup_20170828185051_001_Microsoft.VisualStudio.AspNet45.Feature.log". When I try to execute the same command using the command line tool as administrator I get an error:1206. All attempts made to fix the problem failed. The command cannot work without /ScratchDir set.
Is there a way to set /ScratchDir globally so that all command that ran uses the default or is the a way to append to the command being executed by Visual Studio Installer?
Is there a way to skip the executing of the command?
Anything solution is welcome.

Install Windows Update file (*.msu) without having Windows update service activated

I want to install a specific Windows Update file (.msu) on a device which is running on Windows 7 embedded. The msu file is available and the automated installation is running the right commands, but I have a problem:
On the device, the Windows update service is disabled. This is a requirement from the device image, this service should not be activated (not even for the time of the installation). If I try to install the msu file without this service, an error occurs "The service cannot be started, either because it is disabled or ...".
My question is : Does anyone know a possibility to install a msu file without having the Windows Update Service enabled?
From comment:
Using DISM.exe works if the right command is used.
Additionally, it is important that MSU files cannot be installed using DISM.exe with /Online mode.
You have to unpack the msu file, the resulting *.cab file can then be installed using DISM.exe without enabled Windows update service. See How to use DISM to install a hotfix from within Windows
I'll quote the blog post here:
The purpose of this blog is to give you the steps to install a hotfix
(or any other “package”) on the currently running operating system
using the Deployment Image Servicing and Management (DISM) command.
...
The command-line switch to install a package is “/Add-Package.”
... the file name is “Windows6.1-KB976571-v2-x64.msu.”
... you would assume that following
syntax would work:
DISM.exe /Online /Add-Package /PackagePath:c:\kb976571\Windows6.1-KB976571-v2-x64.msu
You will see the following snippet if you review the file
c:\windows\logs\dism\dism.log:
...
2010-09-02 20:33:58, Error DISM DISM Package Manager: PID=7116
DISM does not support installing MSU files online. –
CMsuPackage::Install(hr:0x80070032)
...
The answer is found in defining what a Microsoft Update Standalone
Package (MSU) file is and how you would do this in the previous
command-line tool, Package Manager (Pkgmgr.exe).
You had to extract the contents of a MSU file and instead use the .CAB
file of the package in order to install or uninstall using the Package
Manager tool
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;940410).
So try this approach:
...
Use the following command to extract the contents of the MSU file:
Expand –F:* c:\kb976571\Windows6.1-KB976571-v2-x64.msu c:\temp\976571
... multiple files, which included the Windows6.1-KB976571-v2-x64.cab
file.
Now try the following command:
...
DISM.exe /Online /Add-Package /PackagePath:c:\temp\976571\Windows6.1-KB976571-v2-x64.cab
... (or) ...
start /wait DISM.exe /Online /Add-Package /PackagePath:c:\temp\976571\Windows6.1-KB976571-v2-x64.cab /Quiet /NoRestart

How to install Visual Studio Remote Tools on Server Core?

I'd like to install the Visual Studio 2013 Update 4 Remote Tools on a Windows 2012R2 Server running IIS 8.5. This is a pretty simple process outlined here: https://msdn.microsoft.com/en-us/library/bt727f1t.aspx
The problem I have is that the server I'm trying to installing this on is a Server Core, meaning, there is no GUI. The Remote Tools application is an exe that only installs via GUI.
I've tried to install it with PowerShell and it just hangs. I'm also not able to find the Remote Tools in Web Platform Installer to install it that way. Extensive Googling has turned up nothing.
Does anyone know how to install the Visual Studio Remote Tools on a Server Core so that I can debug on my DEV server? Any advice is appreciated.
Create a .bat file and enter the below. (not PowerShell) (Or just at the command line.)
rtools_setup_x64.exe" /install /quiet
word...
You don't have to install remote tools. Just copy msvsmon.exe, from your local Visual Studio installation. Then start it from remote powershell silently:
Start-Process -FilePath .\msvsmon.exe -ArgumentList '/nosecuritywarn /port:4022 /silent' -Verb runAs
Don't forget to open firewall port.
Turns out that you can simply remote into the Core server. When you do so, you'll get a command prompt only. From there, CD to the directory where the remote tools install file is. Execute the file by typing the file name at the command prompt, ie: rtools_setup_x64.exe.
This will run the installer, with a GUI, on the Core server. Its that simple, I didn't think you'd be able to get the install wizard on a Core server, however you do.

Resources