See simple script below: NSIS doesn't let me install into the root directory, the "Install" button is grayed out until I enter a different path?!
Reason why I need this: I'd like to make an installer that does actually build an install script for making a backup of a selected directory and compiles it- and I'd sure like to backup the root drive 🙂
Name "Backup"
OutFile "BackupGen.exe"
Caption "Create Backup Script"
; Use Show to let user see directories that are scanned
ShowInstDetails Show
;ComponentText "Check he drives where you want the installer to scan for files." "" "Select drives to scan:"
InstallDir "C:\"
DirText "Select wich directory you want to backup:"
Section "Create Backup Script"
StrCpy $9 $INSTDIR
Ca;...
SectionEnd
Can't install to root?
6 posts
You'll need to change the InstallDir string in:
InstallDir "C:\ " ; So with a space behind C:\!
InstallDir "C:\ " ; So with a space behind C:\!
The default logic is to not allow installs into root directories, primarily for safety reasons. Disabling this would be fairly easy but would require a reinstall. Perhaps I should add a config item to let you change that, but I dunno...
-Justin
P.S. for now, if you don't need the user to be able to select it, you can just not use $INSTDIR, and just use a variable instead...
-Justin
P.S. for now, if you don't need the user to be able to select it, you can just not use $INSTDIR, and just use a variable instead...
Thanks!
In the new versions (newer than 1.8b2) the option AllowRootDirInstall is added. That's what you need, I think!
I've seen that, THANKS!
🙂
🙂