Harsh Upparwal
Harsh Upparwal

Reputation: 19

Passing Special Characters with a space in MSI command-line parameters Across Scenarios

I am using this setup.exe to install the application by passing MSI parameters directly to the MSI via the command line:

setup.exe/s /v"/l*V installer.log INSTALLDIR="""C:\Program Files\Diagnostic manager""" INSTANCE=\"SD-WIN8-02\" REPOSITORY=\"Repository1\" SERVICEUSERNAME=\"SD-WIN8-02\testuser\" SERVICEPASSWORD="/7c2'==V@:~U-L%~*.Rv}CvBV'HHzyAq~'5NGA=" CLUSTERINSTALL=0 SETUPTYPE=Typical ApplicationUsers=AllUsers ALLUSERS=1 /qn"

I'm tackling an interesting challenge with the SERVICEPASSWORD parameter: it must support values containing spaces, double quotes, or both. Specifically, these four scenarios need to work seamlessly:

  1. Simple, no double quotes Example: /7c2'==V@:~U-L%~*.Rv}CvBV'HHzyAq~'5NGA=

  2. Includes a double quote Example: /7c2'==V@:~U-L%~*.Rv}CvB"V'HHzyAq~'5NGA=

  3. Includes a space Example: /7c2'==V@:~U-L%~*.Rv}CvB V'HHzyAq~'5NGA=

  4. The Ultimate Test: Includes both a space and a double quote Example: /7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA=

I've found partial solutions:

The Big Question: How can I modify the parameter handling so all these scenarios are supported reliably? Is there a universal encoding or escaping trick I’m missing?

If you’ve faced a similar issue or have insights on parameter handling for special characters, your advice could be the key to solving this.

Failed Combination for password: /7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA=

INPUT Assumed Reason For Failure
"/7c2'==V@:~U-L%~*.Rv}CvB V'H\"HzyAq~'5NGA=" space not handled, but, double quotes handled!
\"/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA=\" double quotes not handled; space handled
\"/7c2'==V@:~U-L%~*.Rv}CvB V'H\\\"HzyAq~'5NGA=\" double quotes not handled; space handled
\"/7c2'==V@:~U-L%~*.Rv}CvB V'H""HzyAq~'5NGA=\" double quotes not handled; space handled

Upvotes: 1

Views: 28

Answers (0)

Related Questions