benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

Command line max length.

Hi,

I need to pass a number of parameters to a custom action on the command line. Specifically:

/LBL_PORT="[LBL_PORT]" /AUDIT_SERVER="[AUDIT_SERVER]" /AUDIT_PORT="[AUDIT_PORT]" /AUTHENTICATION="[AUTHENTICATION]" /LICENCE_PATH="[LICENCE_PATH]" /SERVICE_DESK_DATABASE_SERVER="[SERVICE_DESK_DATABASE_SERVER]" /SERVICE_DESK_DATABASE_PORT="[SERVICE_DESK_DATABASE_PORT]" /SERVICE_DESK_DATABASE_NAME="[SERVICE_DESK_DATABASE_NAME]" /SERVICE_DESK_DATABASE_USERNAME="[SERVICE_DESK_DATABASE_USERNAME]" /SERVICE_DESK_DATABASE_PASSWORD="[SERVICE_DESK_DATABASE_PASSWORD]" /AUDIT_DATABASE_SERVER="[AUDIT_DATABASE_SERVER]" /AUDIT_DATABASE_PORT="[AUDIT_DATABASE_PORT]" /AUDIT_DATABASE_NAME="[AUDIT_DATABASE_NAME]" /AUDIT_DATABASE_USERNAME="[AUDIT_DATABASE_USERNAME]" /AUDIT_DATABASE_PASSWORD="[AUDIT_DATABASE_PASSWORD]" /CONFIG_FILE="[#MSM_Reloaded_LBL.exe.config]" /INITIAL_USER_FIRST_NAME="[INITIAL_USER_FIRST_NAME]" /INITIAL_USER_LAST_NAME="[INITIAL_USER_LAST_NAME]" /INITIAL_USER_USERNAME="[INITIAL_USER_USERNAME]" /AUDIT_MODE="[AUDIT_MODE]" /LBL_SERVER="[LBL_SERVER]" /UPGRADE="[UPGRADE_LOAD_BALANCER_LICENCING]" /SHARE_USERNAME="[SHARE_USERNAME]" /SERVICE_DESK_CONFIG_FILE="[#Web.config]" /REPORTING_SERVER="[REPORTING_SERVER]" /REPORTING_PORT="[REPORTING_PORT]" /SERVICE_DESK_DATABASE_TYPE="[SERVICE_DESK_DATABASE_TYPE]" /AUDIT_DATABASE_TYPE="[AUDIT_DATABASE_TYPE]"

The action data field has a 255 character limit - I imagine that this is a Windows Installer limitation.

I was originally using a .NET custom action passing the exact same parameters. How do you work around it for .NET custom actions?

Thanks,
Ben
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Command line max length.

Hi Ben,

The following workaround can be applied to all custom actions. All you need to do is to add two "Property Set with Formatted" predefined custom actions which will set two new public properties
to the first and second half of the string.

Then add the two public properties in the command line of the custom action which actually needs this long list of parameters.
Of course the two custom actions that set the properties should be added exactly before your custom action.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

Re: Command line max length.

Brilliant!

Thanks,
Ben

Return to “Common Problems”