0

I am trying to install a desktop application through the command line. The application comes with an installer package, such as setup.exe, which was created using InstallShield.

I am using this setup.exe to install the application by passing MSI parameters directly to the MSI via the command line. For the reference: 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"

The SERVICEPASSWORD parameter is expected to have values containing space, double quotes or both. So accordingly these following four scenarios for password must be accepted:

  1. without space and without double quotes (/7c2'==V@:~U-L%~*.Rv}CvBV'HHzyAq~'5NGA=)
  2. without space and with double quotes (/7c2'==V@:~U-L%~*.Rv}CvB"V'HHzyAq~'5NGA=)
  3. with space and without double quotes (/7c2'==V@:~U-L%~*.Rv}CvB V'HHzyAq~'5NGA=)
  4. with space and with double quotes (/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA=)

For these I have tried: The first scenario worked successfully as is: /7c2'==V@:~U-L%~*.Rv}CvBV'HHzyAq~'5NGA=

The second scenario worked after escaping the double quote with a backslash: /7c2'==V@:~U-L%~*.Rv}CvB\"V'HHzyAq~'5NGA=

The third scenario worked when the value was wrapped in escaped double quotes: \"/7c2'==V@:~U-L%~*.Rv}CvB V'HHzyAq~'5NGA=\"

However, combining both adjustments for the fourth scenario (spaces + double quotes) failed: \"/7c2'==V@:~U-L%~*.Rv}CvB V'H\"HzyAq~'5NGA=\"

How can I modify the SERVICEPASSWORD parameter to ensure the space and double quote are passed correctly in this fourth scenario?

I’m looking for a common solution that reliably supports all four scenarios.

Failed Combination for password having space (between B and V) and double quotes (between H and H):

password (space + double quote) INPUT Assumed Reason For Failure
/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA= "/7c2'==V@:~U-L%~*.Rv}CvB V'H\"HzyAq~'5NGA=" space created not handled
/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA= \"/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA=\" double quotes not handled
/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA= \"/7c2'==V@:~U-L%~*.Rv}CvB V'H\\\"HzyAq~'5NGA=\" double quote not handled
/7c2'==V@:~U-L%~*.Rv}CvB V'H"HzyAq~'5NGA= \"/7c2'==V@:~U-L%~*.Rv}CvB V'H""HzyAq~'5NGA=\" double quotes not handled
6
  • 1
    Why do you ask this question twice at the same time? Passing Special Characters with a space in MSI command-line parameters Across Scenarios Commented Jan 19 at 0:33
  • Does it really make that much sense to allow really ALL special characters to be used in password? As far as I learned that does not make it more secure. It's better to make it longer than to make it more complex. Especially when single and double quotes have special meaning in PowerShell .... 🤷🏼‍♂️ Commented Jan 19 at 0:36
  • @Olaf — “Does it really make that much sense to allow really ALL special characters to be used in password?” There is no such thing as “special character”. For the passwords, the entire Unicode should be allowed. Usually, this is not the case. But the limitations make users waste time and reduce the password strength. The password rules is just one big commonplace stupidity. Commented Jan 19 at 16:51
  • @SergeyAKryukov - I disagree. In my experiences the vast majority of the users would love not to be forced to use capital letters, lower case letters, numbers AND special characters in their passwords. And if the password is long enough it does not weaken the strength irresponsibly. Commented Jan 19 at 20:35
  • @Olaf — “I disagree. In my experience, the vast majority of the users would love not to be forced to use capital letter...” You apparently misread my statement. This is I who said the user should not be enforced. You are not enforced when you are allowed to use the entire Unicode character set. Now, there is no such thing as “majority”. On every occasion, there is only one user, and this user decides what principles should be applied to the choice. It is only possible when there are no limitations. Of course, “use at least one small letter and on capital later” is pure stupidity. Commented Jan 19 at 20:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.