Old 17th July 2012, 09:14   #1
cupid062985
Junior Member
 
Join Date: Jun 2012
Posts: 12
Question InstallDir with Spaces

Hi Guys,

I need some help here.

I try to install an exe file with the following line:

code:

ExecWait "$\"$TEMP\setup.exe$\" /v$\" /norestart /qb INSTALLDIR=$\"C:\Program Files\Folder$\""



but it failed because of the Space.

I was wondering why for MSI packages it work.

code:

ExecWait "msiexec /i $\"$TEMP\setup.msi$\" /quiet /passive /norestart INSTALLDIR=$\"C:\Program Files\Folder$\""



Please help me. I need some light.

Thanks a lot in advance.
cupid062985 is offline   Reply With Quote
Old 17th July 2012, 10:20   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You have one too many quotes in your command:
ExecWait "$\"$TEMP\setup.exe$\" /v$\" /norestart /qb INSTALLDIR=$\"C:\Program Files\Folder$\""
Should be
ExecWait "$\"$TEMP\setup.exe$\" /v /norestart /qb INSTALLDIR=$\"C:\Program Files\Folder$\""

But next time, please use ` or ' quotes to prevent trouble like this. It also makes your code much more readable:

ExecWait `"$TEMP\setup.exe" /v /norestart /qb INSTALLDIR="C:\Program Files\Folder"`
MSG is offline   Reply With Quote
Old 17th July 2012, 10:43   #3
cupid062985
Junior Member
 
Join Date: Jun 2012
Posts: 12
I want to achieve this command line:

code:

setup.exe /v" /norestart /qb INSTALLDIR="C:\Program Files\Folder"



I believe it's not the quotation because if I manually input the following command:

code:

setup.exe /v" /norestart /qb INSTALLDIR="C:\Test"



it will work. I believe $\" is the way of escaping ".

It must have something to do with the space i think... because I coded it the way like the one I posted. Anyways I will try your suggestion.

Thanks a lot...
cupid062985 is offline   Reply With Quote
Old 17th July 2012, 10:47   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
As MSG said above, use ' or `:
code:
ExecWait `"$PLUGINSDIR\setup.exe" /v" /norestart /qb INSTALLDIR="C:\Program Files\Folder"`
Also don't use relative paths.

Stu
Afrow UK is offline   Reply With Quote
Old 17th July 2012, 11:08   #5
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Quote:
Originally Posted by cupid062985 View Post
I believe it's not the quotation because if I manually input the following command:

code:

setup.exe /v" /norestart /qb INSTALLDIR="C:\Test"



it will work.
I think that's a very scary command... I'm not sure how those parameters will be passed to setup.exe. My guess would be that setup recieves only two parameters, namely `/v" /norestart /qb INSTALLDIR="` as the first parameter and `C:\Test"` as the second. This would mean that with a space in the path, it would receive something like `/v" /norestart /qb INSTALLDIR="` as the first parameter, `C:\Program` as the second, and `Files\Folder"` as the third. If that's the case, then it depends entirely on how setup.exe parses its own parameters...

Is there a way to prevent the /v" parameter?
MSG is offline   Reply With Quote
Old 17th July 2012, 11:40   #6
cupid062985
Junior Member
 
Join Date: Jun 2012
Posts: 12
@MSG

the sample is just in the command line. thus it is a relative path...

@Afrow

I already tried the one suggested but it only works on InstallDir with no space. I even changed /v" to /v still the same...

cupid062985 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump