Archive: One of several install directories?


One of several install directories?
I'm distributing a PHP-GTK application that installs on Windows. I want to make this program self-updating - so I'm having it go to the website and download the latest version of itself. The download is packaged in NSIS.

What I'm looking for:

1) Check to see if we have administrative priviledges (can write to Program Files/... )

2) Install to Program Files if possible, otherwise
write to a folder either in the user's Documents area or off the root directory.

Hhow can I do this? Here's my attempt so far:

######################################################
!Define VERSION "4.1.10"
!Define DEFDIR "$PROGRAMFILES\Charterworks\ReportWriter"
; Name of the installer
Name "CharterWorks ReportWriter ${VERSION} Update Installer"
; FULL file path of executable to be built.
OutFile "c:\cworksfiles\A_NUKE.exe"

Section Fubar
SetOutPath $DEFDIR
File "\Program Files\CharterWorks\ReportWriter\*"
IfErrors AltDir MainDir
MainDir:
!Define INSTDIR ${DEFDIR}
Goto DirDone
AltDir:
!Define INSTDIR "\Charterworks\ReportWriter"
Goto DirDone
DirDone:
SectionEnd
######################################################


This does not work. What am I doing wrong?


the file syntax you are using isn't correct. see the manual for the correct usage.