Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 28th September 2009, 05:06   #1
frogdev
Junior Member
 
Join Date: Sep 2009
Posts: 2
CreateDirectory fails

I've got a script with the following code:

Var /GLOBAL HPATH
ReadEnvStr $HPATH HOMEPATH
CreateDirectory "$HPATH\Femtosoft\QuickFrog"

When I run the installer, it says "Created directory \Users\Ken\Femtosoft\QuickFrog".

However, the directory is not created.

I've tried various permutations of this with no success.

I'm attaching the whole install script in case someone would like to look at it.

Thanks for any help.
Attached Files
File Type: nsi quickfroginstallscript.nsi (8.0 KB, 43 views)
frogdev is offline   Reply With Quote
Old 28th September 2009, 07:29   #2
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 546
That is because HOMEPATH does not contain the drive.
Now the path is a relative path, so the folder will be created in the $INSTDIR.
You need to get the HOMEDRIVE as well:
code:
Var /GLOBAL HDRIVE
Var /GLOBAL HPATH
ReadEnvStr $HDRIVE HOMEDRIVE
ReadEnvStr $HPATH HOMEPATH
CreateDirectory "$HDRIVE$HPATH\Femtosoft\QuickFrog"

jpderuiter is offline   Reply With Quote
Old 28th September 2009, 09:21   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
try $PROFILE. But you are not supposed to store files at the root of the profile, use appdata or localappdata

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th September 2009, 03:43   #4
frogdev
Junior Member
 
Join Date: Sep 2009
Posts: 2
Both of you were so right! It's working! Thanks!
frogdev is offline   Reply With Quote
Reply
Go Back   Winamp 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