Uninstalling fails

Hi guys,
I have built a package for installing Project pro 2021.
The installation is working great.
When i try to run an uninstall with batch file, i get an error message.

batch file content:
"%~dp0Deploy-Application.exe" -DeploymentType 'Uninstall'

command line running in deploy-application.ps1
Execute-Process -Path "\\server1\10271\Office2021x64\setup.exe" -Parameters /configure "C:\Install\Uninstall-Project 2021.xml"

What am i missing?

Thank you :slight_smile:

error appearing:

Message        : Cannot process argument transformation on parameter 'WindowStyle'. Cannot convert value
"C:\Install\Uninstall-Project 2021.xml" to type "System.Diagnostics.ProcessWindowStyle". Error:
"Unable to match the identifier name C:\Install\Uninstall-Project 2021.xml to a valid enumerator
name. Specify one of the following enumerator names and try again:
Normal, Hidden, Minimized, Maximized"
InnerException : System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert value
"C:\Install\Uninstall-Project 2021.xml" to type "System.Diagnostics.ProcessWindowStyle". Error:
"Unable to match the identifier name C:\Install\Uninstall-Project 2021.xml to a valid enumerator
name. Specify one of the following enumerator names and try again:
 Normal, Hidden, Minimized, Maximized" ---> System.Management.Automation.PSInvalidCastException:
 Cannot convert value "C:\Install\Uninstall-Project 2021.xml" to type
"System.Diagnostics.ProcessWindowStyle". Error: "Unable to match the identifier name
C:\Install\Uninstall-Project 2021.xml to a valid enumerator name. Specify one of the following
enumerator names and try again:
Normal, Hidden, Minimized, Maximized" ---> System.Management.Automation.RuntimeException: Unable to
match the identifier name C:\Install\Uninstall-Project 2021.xml to a valid enumerator name. Specify
one of the following enumerator names and try again:
Normal, Hidden, Minimized, Maximized
at System.Management.Automation.EnumMinimumDisambiguation.EnumDisambiguate(String text, Type
enumType)
at System.Management.Automation.LanguagePrimitives.ConvertStringToEnum(Object valueToConvert, Type
 resultType, Boolean recursion, PSObject originalValueToConvert, IFor
 matProvider formatProvider,
TypeTable backupTable)
--- End of inner exception stack trace ---

Your Parameter contains spaces.:
/configure “C:\Install\Uninstall-Project 2021.xml”

here are are 2 ways to fix it.

use single-quotes for you parameters:

Execute-Process -Path "\\server1\10271\Office2021x64\setup.exe" -Parameters '/configure "C:\Install\Uninstall-Project 2021.xml" '

use Double-quotes and escape the internal Double-quotes:

Execute-Process -Path "\\server1\10271\Office2021x64\setup.exe" -Parameters "/configure `"C:\Install\Uninstall-Project 2021.xml`" "
1 Like

as usual, correct.
Thank you so much for helping :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.