Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 13th, 2025, 12:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Quote marks
PostPosted: September 9th, 2005, 10:14 am 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
I am launching an installation .msi from Opus, which includes a number of what would otherwise be command line parameters in the format:

Code:
myprog.msi PARAM1="HELLO" PARAM2="WORLD"


The quotes around the values are critical.

These work fine when submitted as a literal command line string, for example picked up from an ini file:

Code:
strParam= GetINIFileData("myprog.ini", "Section", "Param")


However some of the values vary according to previous use input (eg to a variable strVar1), and I was expecting to be able to do something like:

Code:
myprog.msi PARAM1="\"" + strVar1 + "\"".... etc


The resulting string appears visually to be identical, thus:

Code:
myprog.msi PARAM1="HELLO" ... etc


but the Windows installer fails with an Incorrect command line parameters error. This suggests that some other non-printing character is being generated with the backslash-doublequote.

Can anyone throw any light on this? Thanks.

_________________
A crack on the head / Is what you get for not asking
And a crack on the head / Is what you get for asking

Barbarism Begins At Home, The Smiths


Top
 Profile  
 
 Post subject: Re: Quote marks
PostPosted: September 9th, 2005, 11:44 am 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
Linnet wrote:
Code:
myprog.msi PARAM1=""" + strVar1 + """.... etc


Can you post exactly what you have for that line? I know from experience it's very easy to get these things slightly wrong. :?


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 9th, 2005, 11:52 am 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
Hi

This is the launch string:

Code:
LaunchFile(strLaunch,strParamPre + " " + strParamMain + " " + strParamArgue + " PROFILELEVEL = \"" + PUB_RADIOBUTTON + "\"")


where the various string vars have been read in from an .ini file, for example:

Code:
Launch=SYSTEM_WINSYS_DIR + "\\msiexec.exe"
ParamPre="/i"
ParamMain=SYSTEM_PUBLICATION_DIR+"\\some.msi"
ParamArgue = SOMEPARAM="true"


PUB_RADIOBUTTON carries a value such as "A" or "B". If I include PROFILELEVEL="A" within the ParamArgue string, then it works OK. As you say probably something fairly subtle (or very obvious).

Thanks, Linnet


Top
 Profile  
 
 Post subject:
PostPosted: September 9th, 2005, 12:10 pm 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
You say that PROFILELEVEL="A" works, but your code has spaces around the equals, so it'd be PROFILELEVEL = "A", which is probably why it doesn't work.

Also you've got

Code:
ParamArgue = SOMEPARAM="true"


Which I'm guessing should be

Code:
ParamArgue = "SOMEPARAM=\"true\""


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 9th, 2005, 2:04 pm 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
Hi Dave

Doh! You were absolutely right about the spaces. Thanks a million.

Linnet


Top
 Profile  
 
 Post subject:
PostPosted: September 9th, 2005, 2:07 pm 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
No problem. When you're putting \" inside other quotes, it's almost impossible to follow what it's doing. :wink:


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group