Old 30th June 2014, 11:09   #1
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
Angry NIS 2.x chokes on installdir

This is my first post.
I am on windows 7 and I am trying to create an install to the document directory and sub directory but it chokes on space. Here is what I have...

;--------------------------------
; The default installation directory
InstallDir $Documents\Laughingbird Documents\Logo Elements\Tonys Work
; Request application privileges for Windows Vista
RequestExecutionLevel user

;--------------------------------
from the default install that came with it. How do I get around it to install? I looked
atfpodcast is offline   Reply With Quote
Old 30th June 2014, 14:40   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
You need to quote (") strings with spaces...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd July 2014, 00:15   #3
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
still did not work.
atfpodcast is offline   Reply With Quote
Old 2nd July 2014, 00:16   #4
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
;--------------------------------
; The default installation directory
InstallDir $Documents\Laughingbird" "Documents\Logo" "Elements\AptA
; Request application privileges for Windows Vista
RequestExecutionLevel user

;--------------------------------

Processing script file: "C:\Users\Tony\Desktop\lb_install.nsi"
Name: "apta a icon element installer"
OutFile: "install.exe"
Error: unterminated string parsing line at C:\Users\Tony\Desktop\lb_install.nsi:19
Error in script "C:\Users\Tony\Desktop\lb_install.nsi" on line 19 -- aborting creation process

This is using the example.nsi and changing it to install files.
atfpodcast is offline   Reply With Quote
Old 2nd July 2014, 00:21   #5
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
I even use the splash.nsi and it wont work. dont see nothing. I have the .bmp file there.
atfpodcast is offline   Reply With Quote
Old 2nd July 2014, 03:47   #6
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
Ok I got the splash to screen to work but it still wont work if I put
InstallDir $Documents\Laughingbird" "Documents\Logo" "Elements\AptA

if I go

InstallDir $Documents\Laughingbird""Documents\Logo""Elements\AptA it will compile but then the user would have to add the spaces and I know people will just install. so how can I fix this? IM gonna post my whole script
atfpodcast is offline   Reply With Quote
Old 2nd July 2014, 03:52   #7
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
; Installs my graphics pack for Laughingbird Software The Logo Creator.
;--------------------------------

; The name of the installer
Name "Apartment A Productions Installer"

; The file to write
OutFile "install.exe"

Function .onInit
SetOutPath $TEMP
File /oname=spltmp.bmp "apta.bmp"

; optional
; File /oname=spltmp.wav "my_splashshit.wav"

splash::show 5000 $TEMP\spltmp

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.

Delete $TEMP\spltmp.bmp
; Delete $TEMP\spltmp.wav
FunctionEnd

;--------------------------------
; The default installation directory
InstallDir $Documents\Laughingbird""Documents\Logo""Elements\AptA
; Request application privileges for Windows Vista
RequestExecutionLevel user

;--------------------------------

; Pages

Page directory
Page instfiles

;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File club33fancy.png

SectionEnd ; end the section
atfpodcast is offline   Reply With Quote
Old 2nd July 2014, 07:07   #8
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
You have to quote the whole string, not just the spaces...
code:
InstallDir "$Documents\Laughingbird Documents\Logo Elements\Tonys Work"
jpderuiter is offline   Reply With Quote
Old 2nd July 2014, 07:32   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The script parser uses whitespace as a token delimiter. If your argument/parameter contains spaces then you need to surround the entire string with quotes (", ' or `) to make it parse as a single token.

Stu
Afrow UK is offline   Reply With Quote
Old 2nd July 2014, 09:49   #10
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
Quote:
Originally Posted by Afrow UK View Post
The script parser uses whitespace as a token delimiter. If your argument/parameter contains spaces then you need to surround the entire string with quotes (", ' or `) to make it parse as a single token.

Stu
so

InstallDir "$Documents\Laughingbird Documents\Logo Elements\AptA"
???
What if I wanted to install files in that directory and another directory in the Laughingbird Documents directory and I did not need the users input?

Would I have to do two sections to achieve it?
atfpodcast is offline   Reply With Quote
Old 2nd July 2014, 12:23   #11
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
Quote:
Originally Posted by atfpodcast
What if I wanted to install files in that directory and another directory in the Laughingbird Documents directory and I did not need the users input?
Quote:
InstallDir "$Documents\Laughingbird Documents"

Section
; SetOutPath creates directories if they don't exist.
SetOutPath "$INSTDIR\Logo Elements\AptA"
; files go here

SetOutPath "$INSTDIR\some other dir"
; other files go here

SectionEnd
This is the basics for installing files to different directories. You need the lowest common directory, and you add you're own paths to it.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 2nd July 2014, 21:43   #12
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
Question

So still use file to put them there and the file again after to put in another directory?

InstallDir "$Documents\Laughingbird Documents"

Section
; SetOutPath creates directories if they don't exist.
SetOutPath "$INSTDIR\Logo Elements\AptA"
; files go here

file thisfile.jpg
file yourfile.jpg

SetOutPath "$INSTDIR\some other dir"
; other files go here

file afilehere.png
file card.jpg

SectionEnd



Now will this show it installing with a gui with out users input? I am reading up on silent install but I want them to see an automated install.

Last edited by atfpodcast; 2nd July 2014 at 23:03.
atfpodcast is offline   Reply With Quote
Old 3rd July 2014, 08:25   #13
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
Quote:
Originally Posted by atfpodcast View Post
Now will this show it installing with a gui with out users input? I am reading up on silent install but I want them to see an automated install.
Here's a basic automated installer:
Quote:
Originally Posted by test.nsi
Name "Test"
OutFile "Test.exe"

RequestExecutionLevel User
ShowInstDetails Show

Page InstFiles

Section
DetailPrint "Sleep for 5 seconds."
Sleep 5000
SetAutoClose True
SectionEnd
"SetAutoClose True" closes the installer after the InstFiles page is finished. The default is False.

File extracts files to the current directory, which is set using SetOutPath.

So you use SetOutPath to set the directory, and File to extract a file to that directory.

Quote:
Originally Posted by TestSetOutPath.nsi
Name "TestSetOutPath"
OutFile "TestSetOutPath.exe"

RequestExecutionLevel User
ShowInstDetails Show

Page InstFiles

Section
SetOutPath "$EXEDIR\folder1"
File "TestSetOutPath.nsi"

SetOutPath "$EXEDIR\folder2"
File "TestSetOutPath.nsi"

SetOutPath "$EXEDIR\folder3"
; Some other files

SectionEnd

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 3rd July 2014, 08:44   #14
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
I got it to work now. I commented out the directory page and it all works. Added license info too..
atfpodcast is offline   Reply With Quote
Old 3rd July 2014, 08:59   #15
atfpodcast
Junior Member
 
Join Date: Jun 2014
Posts: 30
Here are the changes...
; Installs my graphics pack for Laughingbird Software The Logo Creator.
;--------------------------------
;
!define Version "v1.0"
; installer name
Name " Characters Elements"

; The file to write
OutFile "setup.exe"
!define MUI_ICON "apta_icon.ico"
icon apta_icon.ico


; Show install details
ShowInstDetails show

Function .onInit
SetOutPath $TEMP
File /oname=spltmp.bmp "splash.bmp"
splash::show 4000 $TEMP\spltmp
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
Delete $TEMP\spltmp.bmp
FunctionEnd

;--------------------------------

; The default installation directory

InstallDir "$Documents\Laughingbird Documents\Logo Elements\Vector Characters"

; InstallDir "$Documents\Laughingbird Documents\Logo Logo Libraries\"

; Request application privileges for Windows Vista
RequestExecutionLevel user

;--------------------------------

; Pages

Page license
LicenseData license.txt
;Page directory
Page instfiles

;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File C:\Users\Tony\Desktop\stuff\ai\vector\png\biz_man.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\biz_woman.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\casual_girl.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\chef.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\female_doc.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\girl_megaphone.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\santa.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\superhero.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\woodboy.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\woodgirl.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\xmas_girl1.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\xmas_girl2.png
File C:\Users\Tony\Desktop\stuff\ai\vector\png\xmas_girl3.png

SectionEnd ; end the section
atfpodcast 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