Hi,
I have a simple NSIS script with a directory page, where the user can select a directory to install the application to. See the example below, if the app is already installed, it takes the value from the registry or else the www root or else "program files\publisher\product name".
The problem is that when I click browse on the directory page and select a specific directory (e.g: c:\test), when I close the browse dialog the define PRODUCT_NAME is automatically added to the path: c:\test\Invoice Management Workflow. How can I avoid the product name being added automatically"?
!define PRODUCT_NAME "Invoice Management Workflow"
!insertmacro MUI_DEFINES
!insertmacro MUI_PAGE_WELCOME
Page directory DirPre
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
Function DirPre
; set the INSTDIR to
ReadRegStr $0 HKLM "Software\${PRODUCT_PUBLISHER}\${PRODUCT_NAME}" "InstallDirectory"
${If} $0 != ""
StrCpy $INSTDIR $0
Abort
${Else}
; get the install dir from reg
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\InetStp" "PathWWWRoot"
${If} $0 != ""
StrCpy $INSTDIR $0
${EndIf}
${EndIf}
FunctionEnd