frogdev
28th September 2009 06:06 UTC
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.
jpderuiter
28th September 2009 08:29 UTC
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:
Var /GLOBAL HDRIVE
Var /GLOBAL HPATH
ReadEnvStr $HDRIVE HOMEDRIVE
ReadEnvStr $HPATH HOMEPATH
CreateDirectory "$HDRIVE$HPATH\Femtosoft\QuickFrog"
Anders
28th September 2009 10:21 UTC
try $PROFILE. But you are not supposed to store files at the root of the profile, use appdata or localappdata
frogdev
29th September 2009 04:43 UTC
Both of you were so right! It's working! Thanks!