Problems with uninstall

<pre class=“brush: powershell; gutter: true; first-line: 1; highlight: []; html-script: false”>
#<Perform Uninstallation tasks here>

Uninstall application

Execute-MSI -Action &#039;Uninstall&#039; -Path &#039;{9CCB4BE4-3394-42F3-9DE8-3C611E4E7A71}&#039;
Execute-MSI -Action &#039;Uninstall&#039; -Path &#039;Mobility_xg_client_11.04_Win7_x64_release.msi&#039;

I’m trying to run the uninstall through SCCM. Here is the section I have in my Uninstall section. I’m trying both methods of Execute-MSI. I also tried Remove-MSI

I get an error in the log of [Uninstallation] :: The MSI is not installed on this system. Skipping action [Uninstall].

When I run the script manually, it uninstalls fine. Its just when I do an uninstall from Software Center that it fails.

Also, here is my command line for uninstall in my deployment type PowerShell.exe -Executionpolicy bypass .\Deploy-Application.ps1 -DeploymentType “Uninstall”

Any ideas?

All, I found a work around. To recap, when running the script from an SCCM application, Execute-MSI -Action ‘Uninstall’ -Path ‘{GUID}’ was returning an error saying the app was not installed (it was). I also tried Remove-MSIAPplications -Name ‘AppName’ and it returned the same error saying it was not installed (it was).

When manually running this same script from an elevated command prompt using deploy-application.exe -DeploymentType Uninstall, the script would uninstall perfectly fine.

I tried Execute-Process -Path ‘msiexec.exe’ -Parameters ‘/x {GUID} /qn /norestart’ from the SCCM application and it worked.

It could be the process is started as 32 bit and is not seeing the 64 bit registry parts to detect the GUID. When you manually start the the script from a 64 bit CMD or Powershell it will work as the registry parts can be found.