1

I created a MSI package using wix installer where I used power shell to execute some commands. Normal command prompt not works because it prompt popup window on the middle of installation for user permission and confirmation

<SetProperty Id="InvokeTestPS1"
             Before="InvokeTestPS1"
             Sequence="execute"
             Value ="&quot;[POWERSHELLEXE]&quot; -Version 2.0 -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command &quot;&amp; '[APPLICATIONROOTDIRECTORY]Upgrade\upgradeMentor3_5.bat' ; exit $$($Error.Count)&quot;" />
<CustomAction Id="InvokeTestPS1"
              BinaryKey="WixCA"
              DllEntry="CAQuietExec64"
              Execute="deferred"
              Return="check"
              Impersonate="no" />

Installer with the above code work sin most of our machines but in one machine installation rollsback and shown below error

"The version v2.0.50727 of the .NET Framework is not installed. This version is required to run version 2.0 of Windows PowerShell."

Our all machines are windows10 and powershell preinstalled, why in one of the machine it shows error. Any input willbe a great help

Sijith
  • 3,740
  • 17
  • 61
  • 101
  • Look at MSI logs – Pavel Anikhouski Jan 22 '21 at 10:07
  • Powershell requires the .NET framework to run. If the .NET runtime is broken or the whole .NET version you require is missing things obviously can't run. You should also not run [batch files](https://stackoverflow.com/a/51092664/129130) of any kind in MSI due to poor error handling and reliability. Powershell is also bad since it involves dependency on the .NET runtime and is very poorly integrated in the old MSI technology (a bit wobbly). **What does the batch file do? There might be better alternatives.** – Stein Åsmul Jan 22 '21 at 14:56
  • Batch file is used to uninstall some other software while installing my software. There is no relation with the software I am uninstalling while installing mysoftware – Sijith Jan 29 '21 at 05:14

0 Answers0