custom action parameters with spaces (AI version 5.2.2) - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mjs
Posts: 13
Joined: Mon Jul 23, 2007 5:00 pm

custom action parameters with spaces (AI version 5.2.2)

I need to pass in the path to the install file to a custom action written in c#.

/TARGETDIR=[APPIDIR]\Servicename

If the path has spaces in it, the custom action always reads this as two command line arguments instead of one.

I have tried all of the following:

/TARGETDIR="[APPIDIR]\Servicename"
"/TARGETDIR=[APPIDIR]\Servicename"
/TARGETDIR='[APPIDIR]\Servicename'
""/TARGETDIR=[APPIDIR]\Servicename"
/TARGETDIR=""[APPIDIR]\Servicename"

AI seems to be stripping off the beginning quotes and leaving the end quotes when it gets passed to the custom action. Single quotes don't get stripped, but the args are still recognized as 2 params when single quotes are used.

HELP!
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Try without the "\" character after [APPDIR] (note that you are using an incorrect Property value [APPIDIR]):

Code: Select all

/TARGETDIR="[APPDIR]Servicename"
Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
mjs
Posts: 13
Joined: Mon Jul 23, 2007 5:00 pm

I am using APPDIR, that was just a typo (broken wrist, difficult to type :? )

And I am actually using /TARGETDIR="[APPDIR]Servicename" (that was also a mistake in my question, sorry)

None of the above cases work with /TARGETDIR=[APPDIR]Servicename


Here is the line from the aip file

Code: Select all

<ROW Action="CustomActionExe.exe" Type="3090" Source="CustomActionExe.exe" Target="/TARGETDIR="[APPDIR]VaultService\"  /TARGETDIR2="[APPDIR]Fortress\" /PARAMS=[PARAMS] /DROPDB=[DROPDB] /UPGRADE=[UPGRADE_1] /ADMINPW=[ADMINPW] /SQLSERVER="[SQLSERVER]" /WINAUTH=1"/>
    
Here is the output from that parameter string in my code. Each seperate line is a differnt command line argument sent down to my code if APPDIR has a space.

Code: Select all

/TARGETDIR=C:\Fortress     Server\VaultService"  /TARGETDIR2=C:\Fortress
	Server\Fortress"
	/PARAMS=
	/DROPDB=
	/UPGRADE=
	/ADMINPW=
	/SQLSERVER=
	/WINAUTH=1
I want the command line params to be read in as follows

Code: Select all

/TARGETDIR="C:\Fortress Server\VaultService"
/TARGETDIR2="C:\Fortress Server\Fortress"
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

The problem is that you are using a "\" character after "VaultService" and "Fortress" which causes the next quote character to be escaped. You should either remove the "\" character or if this is needed, put a space after the "\" character.

Thus, if you use the second approach, the "Action Data" field will be:

Code: Select all

/TARGETDIR="[APPDIR]VaultService\ " /TARGETDIR2="[APPDIR]Fortress\ " /PARAMS=[PARAMS] /DROPDB=[DROPDB] /UPGRADE=[UPGRADE_1] /ADMINPW=[ADMINPW] /SQLSERVER="[SQLSERVER]" /WINAUTH=1
Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
mjs
Posts: 13
Joined: Mon Jul 23, 2007 5:00 pm

Thanks!! That worked.

You guys are great :)

Return to “Common Problems”