Archive: n00b at this, little help please


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


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


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

; 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

mmm


SetOutPath $windows\fonts

Try

SetOutPath $WINDIR\Fonts

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

Or even:

SetOutPath $FONTS

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:


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..

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


So it should be like this??


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

indeed it should.