My understanding of NSIS is pretty rudimentary and I've mostly cookbooked my way along. The idea of loading a gigabyte sized file into memory from DVD and decompressing it sets off a lot of alarm bells for me. Can (or should) I break the installer file into smaller pieces, and if so how would I do this? My installer script is pretty basic, using a few File /r "Install\*.*" commands, without reference to external ini files, etc.
I am also having trouble with creating an uninstaller. This is data for other applications, so it is installed into the existing application directory structure. My installers use the application directory as $INSTDIR and install to appropriate sub-directories via the File /r "Install\*.*" commands. Nothing is actually written to $INSTDIR, just its subdirectories. Generally there are AppDir\DataDir\MyDataDir\*.* and AppDir\ConfigDir\MyConfigFile.ext. I'm using the directory structure of "Install\*.*" to put everything where it belongs. MyDataDir contains about 1200 branching subdirectories and tens of thousands of small data files.
I can uninstall the data files by writing uninstall.exe to MyDataDir and using RMDir /r "$INSTDIR". This approach sets off more alarm bells and doesn't remove MyConfigFile.ext. I've tried to create a variable for this file and explicitly delete it, without success. As I say, my grasp of NSIS is very limited. Since the number of files and folders is so large, I don't really want to try to create a log file of all the individual files and paths during installation. Could someone recommend a good solution to this?
Also, are there any built-in strings for the uninstaller that would appear in the uninstaller in other languages (like the installer pages)?
The uninstaller part of my script is:
ThanksSection -Post
WriteUninstaller "$INSTDIR\MyDataDir\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
"DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
"UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
"DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
"URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
"Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully
removed from your computer."
FunctionEnd
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you
want to completely remove $(^Name) and all of its components?
This will delete the directory $INSTDIR and all files it contains." IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\ConfigDir\MyConfigFile.ext" ### I know this is wrong!
Delete "$SMPROGRAMS\NSIS_Test-00\Uninstall.lnk"
Delete "$SMPROGRAMS\NSIS_Test-00\Website.lnk"
RMDir /r "$SMPROGRAMS\NSIS_Test-00"
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd