Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

How to pass a value with whitespace characters to a property through the command line in InstallShield Suite Project?


I did a setup using InstallShield Suite. Please mind that. An InstallShield project is not the same thing as InstallShield Suite project!

This setup installs Erlang and RabbitMq and then configures RabbitMQ. Before installation I need to pass the path to a folder in which the RabbitMQ database will be placed. For this reason I created a property "RabbitMQ_DbPath" in my setup.
Now I want to set this property through the command line. For the sake of simplicity: The name of my setup is MySetup.exe. The path I want to pass is C:\Databases and Logs\Database. As you can see, this path contains whitespaces (in the part Database and Logs). I've tried a lot and don't know how to escape these whitespaces. I read the documentation carefully, it can be found here:

I have to say the documentation is poor! It doesn't say how to escape whitespace characters on the command line.

I've already tried the following:

  1. .\MySetup.exe RabbitMQ_DbPath=C:\Databases and Logs\Database
  2. .\MySetup.exe RabbitMQ_DbPath="C:\Databases and Logs\Database"
  3. .\MySetup.exe RabbitMQ_DbPath=\"C:\Databases and Logs\Database\"
  4. .\MySetup.exe RabbitMQ_DbPath='"C:\Databases and Logs\Database"'
  5. .\MySetup.exe RabbitMQ_DbPath=[C:\Databases and Logs\Database]
  6. .\MySetup.exe RabbitMQ_DbPath=C:\Databases^ and^ Logs\Database
  7. .\MySetup.exe /v"RabbitMQ_DbPath=\"C:\Databases and Logs\Database\""
  8. .\MySetup.exe /v"RabbitMQ_DbPath="C:\Databases and Logs\Database""

In all cases, I've seen an error saying that my command line arguments are incorrect (I am sure, it's because of whitespace characters in the path). If I tried to pass the path without characters, it worked fined.

How can I pass my path through the command line? My path must have includes whitespace characters. I mean, I can't change it.

The version of my InstallShield is InstallShield 2018 R2 Premier Edition with Virtualization Pack. I can't select this version in the labels for my question. Why??? There is the version, but there is no tag for it.

Best regards,

Labels (2)
0 Kudos
(10) Replies
Level 8

0 Kudos

Hello Markus,

I read the linked article but I still don't understand how I should use it in the command line?!

This line seems to be weird, nevertheless I tried it out. This didn't work!
.\MySetup.exe RabbitMQ_DbPath=LongPathToQuote("C:\Databases and Logs\Database", TRUE)


0 Kudos
Level 8

Okay sorry for the delay and for the case of a Suite the way is different the problem is the same. The receiving application needs " around the path with the space characters.

But it is also important what type of "setup" is your "MySetup.exe". Is it a MSI-Project with a Bootstrapper or is it an other type of setup (InstallScript or something else).



0 Kudos

My project has the extension .iss, it is a Suite Project. I don't understand how I can specify the type of my project precisely. In the very first post in this topic I pasted a link to the documentation to this type of project:

The header of this web page says "Advanced UI and Suite/Advanced UI Setup.exe". So I can see from this link that my project is either Advanced UI or Suite/Advanced UI

Or, if you mean, what is inside of my project: The setup for Erlang from the official web page and the setup for RabbitMQ from the official web page.

You wrote: "The receiving application needs " around the path with the space characters".
Exactly. I understand that. But I do not understand how the character " can be escaped.
How is that done for the projects of type Advanced UI or Suite/Advanced UI?

Please read my first post once more. In this post I wrote, which type of the project I have and what I have already tried to pass this path parameter to the property.

Here is the screenshot:
In the window with error stays something like that:  The setup command line is invalid. Setup cannot continue. But in German.

0 Kudos
Level 8

Okay, nur nochmal als Zusammenfassung:

Dein "MySetup.exe" ist Deine InstallShield-Suite und an diese möchtest Du einen Wert für Deine Eigenschaft/Property "RabbitMQ_DbPath" übergeben ?

Im Fall der Suite wäre das dann:

MySetup.exe /RabbitMQ_DbPath:"C:\Databases and Logs\Database"

Aber um das nochmal zu verifizieren, würde ich Dir empfehlen das so zu starten:

MySetup.exe /debuglog"C:\Temp\Setup.log" /RabbitMQ_DbPath:"C:\Databases and Logs\Database"

Unter der Voraussetzung, daß C:\Temp existiert, sonst einfach ein anderes Verzeichnis angeben. Dann in der Protokolldatei "Setup.log" nachsehen, wie RabbitMQ_DbPath gelesen wurde. Eventuell die Anführungszeichen und/oder inversen Schrägstriche maskieren.



0 Kudos

Dein "MySetup.exe" ist Deine InstallShield-Suite und an diese möchtest Du einen Wert für Deine Eigenschaft/Property "RabbitMQ_DbPath" übergeben ?

Das ist korrekt.

Ich habe jetzt folgende Varianten probiert:
.\MySetup.exe /debuglog"C:\log.log" /RabbitMQ_User:"Username" /RabbitMQ_DbPath:"C:\Test 1\"
.\MySetup.exe /debuglog"C:\log.log" RabbitMQ_User="Username" RabbitMQ_DbPath="C:\Test 1\"

In beiden Fällen wurde der Parameter RabbitMQ_User übergeben (er enthält keine Leerzeichen). RabbitMQ_DbPath jedoch nicht. Der Fehler ist wie auf dem Bild aus meiner letzten Nachricht hier. In der Log-Datei steht:
9-15-2021[09:53:54]: Engine: property 'RabbitMQ_User' value now 'Username'
9-15-2021[09:53:54]: Engine: invalid command line

Hier sollte ich anmerken, dass dieses Verhalten nicht an dem Property liegt. Wenn ich versuche, einen Wert mit Leerzeichen an RabbitMQ_User zu übergeben, klappt es auch nicht. Der selbe Fehler wird angezeigt.

Ich habe schon viele unterschiedliche Konstellationen für die Maskierung ausprobiert. Nichts davon hat funktioniert. Habe auch Revenera direkt angeschrieben. Die haben mir aber bis dato nicht geantwortet.

0 Kudos

Thank you for your question I will take this internally to the development team and let you know what their response is. Thank you for your patience and support. 

Even if my original goal has been achieved (answered by Markus Latz), I am still interested in how to pass a value with spaces to the setup via PowerShell.
For instance, this didn't work:
.\MySetup.exe /RabbitMQ_DbPath=`"C:\Databases and Logs\Database\`"

0 Kudos
Level 8

The problem is, that @iamarden calls his "MySetup.exe" from a powershell window. If I do this I get the same error.  I'm not firm with powershell, but I suppose, that this is a problem of how powershell passes arguments to a calling process.



I tested this with a sample suite in InstallShield 2016, which you can load in your InstallShield 2018



0 Kudos

Thank you for your help.

In fact, it works from the cmd.exe. But not from PowerShell. I just didn't think of it because I mostly work with PowerShell. Nonetheless, your answer helped me a lot.

My original goal was to transfer a value to the property RabbitMQ_DbPath via a so-called WiX Bootstrapper (WiX Toolset).
That's how I did it originally:
<PackageGroup Id="CommonServices">
<ExePackage Id="MySetup" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
SourceFile="..\Setups\MySetup\MySetup.exe" InstallCommand='/silent /debuglog"[WixBundleOriginalSourceFolder]\MySetup.log" RabbitMQ_User=[Param_USERNAME] RabbitMQ_Password=[Param_PASSWORD] RabbitMQ_DbPath="[Param_PATH]"'/>

That didn't work.
But i tried it in another way: Indteas of the InstallCommand from above I used this one:
InstallCommand='/silent /debuglog"[WixBundleOriginalSourceFolder]\MySetup.log" /RabbitMQ_User:"[Param_USERNAME]" /RabbitMQ_Password"[Param_PASSWORD]" /RabbitMQ_DbPath:"[Param_PATH]"'
And that worked.

0 Kudos