Old 21st October 2004, 09:09   #1
mentalmike
Guest
 
Posts: n/a
n00b at this, little help please

Hi I'm a n00b at this and trying to make a very basic intaller.

All I want it to do is copy a few files to different directories - all doc & settings\all users\programs and windows\fonts. I don't need the user to set this, I'm just unsure on how you use mulitple files as all the examples user one file.
Thanks for any help
  Reply With Quote
Old 21st October 2004, 10:17   #2
mentalmike
Guest
 
Posts: n/a
ok here is my code, i'm unsure on what to do from here, hopefully you'll be able to see what i'm trying to do

code:

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

; The name of the installer
Name "File Installer"

; The file to write
OutFile "File Installer"

; uncomment the following line to make the installer silent by default.
SilentInstall silent

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

Function .onInit
Section ""
MessageBox MB_OK|MB_ICONINFORMATION 'This will install shortcuts, fonts and auto logon registry keys'

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

; The stuff to install
Section ""

; Set output path to the installation directory.
SetOutPath $windows\fonts

; Put file there
File "..\Co1_____.ttf"

; Set output path to the installation directory.
SetOutPath $Documents and Settings\All Users\Start Menu

; Put file there
File "..\Reject_Booking_Menu.xs"

; write reg
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "DefaultUserName" "wibble"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "AutoAdminLogon" '"1"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DefaultPassword" '"hello"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DefaultDomainName" '"abc"

SectionEnd

  Reply With Quote
Old 21st October 2004, 13:46   #3
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
mmm
code:

SetOutPath $windows\fonts


Try
code:

SetOutPath $WINDIR\Fonts


Read the docs about the NSIS' constants....


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 21st October 2004, 17:06   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Or even:
code:
SetOutPath $FONTS

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 17th November 2004, 19:47   #5
paulheu
Junior Member
 
Join Date: Nov 2004
Posts: 3
That don't work for me either.. It seems the $FONTS var is not resolved. If I use the full path the font copies over fine, but using $FONTS just gives an error:
code:

Section "djDecks Skin ${SKINNAME} (required)" SecCopyUI


;Main Files
SetOutPath "$INSTDIR\skins"
File "${APP_DIR}\${SKINNAME}.xml"
File "${APP_DIR}\${SKINNAME}.txt"

SetOutPath "$INSTDIR\skins\${SKINNAME}"
File /nonfatal "${APP_DIR}\${SKINNAME}\*.jpg"
File /nonfatal "${APP_DIR}\${SKINNAME}\*.gif"
File /nonfatal "${APP_DIR}\${SKINNAME}\*.bmp"

;SetOutPath "C:\WINDOWS\FONTS"
;File "C:\WINDOWS\FONTS\DigitalDreamFat.ttf"

SetOutPath "$FONTS"
File "$FONTS\DigitalDreamFat.ttf"

SectionEnd


Using the lines with $FONTS don't work, switch to the lines with the full path and it's OK..
paulheu is offline   Reply With Quote
Old 17th November 2004, 21:09   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You are confusing run-time with compile-time!

$FONTS is the constant that will contain the user's Fonts folder path on run-time.

The File command will store a file on compile-time into your installer, and thus you must give it the path to a file to compress on your hard-drive (not on the user's!)

-Stu
Afrow UK is offline   Reply With Quote
Old 17th November 2004, 22:09   #7
paulheu
Junior Member
 
Join Date: Nov 2004
Posts: 3
So it should be like this??
code:

SetOutPath "$FONTS"
File "C:\windows\fonts\DigitalDreamFat.ttf"

paulheu is offline   Reply With Quote
Old 18th November 2004, 15:04   #8
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
indeed it should.
Comm@nder21 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