Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 8th June 2005, 09:45   #1
geoffrey_4js
Junior Member
 
Join Date: Jan 2005
Location: Strasbourg - FRANCE
Posts: 43
Send a message via ICQ to geoffrey_4js Send a message via Yahoo to geoffrey_4js
Trouble with GetFullPathName

Hello,

I'm using NSIS 2.06 and there's a place in my code where GetFullPathName doesn't seem to work.

I'm using the MUI interface and call the MUI_DIRECTORY_PAGE this way :

code:
!define MUI_PAGE_CUSTOMFUNCTION_PRE Defaults.onPreDirPage
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE Defaults.onLeaveDirPage
!insertmacro MUI_PAGE_DIRECTORY



In the Defaults.onLeaveDirPage, I need to be sure that $INSTDIR is a full path so I do :

code:
Function Defaults.onLeaveDirPage
Push $R0 ; The return value of the function 'FileOrDirStatus'
Push $R1

GetFullPathName $INSTDIR $INSTDIR

; Determines the status of the installation directory
${FileOrDirStatus} $R0 "$INSTDIR"
${Select} "$R0"
${Case2} "empty" "does not exist"
${CaseElse}
${IfCmd} MessageBox MB_YESNO|MB_ICONQUESTION $(Defaults_Ask_InstDirNotEmpty) IDNO ${||} StrCpy $ABORT_FLAG "true" ${|}
${EndSelect}

${Unless} "$ABORT_FLAG" == "true"
WriteIniStr "$PLUGINSDIR\${UNINSTALL_INI_FILE}" "Main.data" "InstallDirectory" "$INSTDIR"
${EndUnless}

Pop $R1
Pop $R0
Call Defaults.abortIfRequired
FunctionEnd



But this doesn't work as I've always INSTDIR as a short path if I type it as a short path on the MUI_DIRECTORY_PAGE.

I've try the following things without success:

1.
GetFullPathName $R1 "$INSTDIR"
StrCpy $INSTDIR $R1

2.
GetFullPathName $R1 $\"$INSTDIR$\"
StrCpy $INSTDIR $R1

3.
GetFullPathName $INSTDIR "$INSTDIR"

I can't see what to try now to make this work. Any idea ?
geoffrey_4js is offline   Reply With Quote
Old 9th June 2005, 17:31   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
Call GetLongPathName using the System plug-in.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 10th June 2005, 07:09   #3
geoffrey_4js
Junior Member
 
Join Date: Jan 2005
Location: Strasbourg - FRANCE
Posts: 43
Send a message via ICQ to geoffrey_4js Send a message via Yahoo to geoffrey_4js
Thank you Kichik, I'll try this.
geoffrey_4js 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