AdvUninstLog.nsh에서 UNINST_EXE
과 관련된 내용, 특히 WriteUninstaller
줄을 주석 처리해야합니다. .dat와 설치 제거 프로그램을 같은 디렉토리에두고 싶다면 안전한 디렉토리에 별도의 디렉토리를 사용했습니다.
...
!include AdvUninstLog.nsh
!insertmacro UNATTENDED_UNINSTALL
Page Directory
Page InstFiles
Function .onInit
!insertmacro UNINSTALL.LOG_PREPARE_INSTALL
FunctionEnd
Function .onInstSuccess
!insertmacro UNINSTALL.LOG_UPDATE_INSTALL
FunctionEnd
Section "Main Application"
SetOutPath "$InstDir\foo"
WriteUninstaller "$InstDir\foo\uninst.exe"
SetOutPath "$InstDir\data"
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
File /r "${NSISDIR}\Plugins\*" ; "random" files
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir" "$InstDir"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "DisplayName" "${APP_NAME}"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "UninstallString" '"$InstDir\foo\uninst.exe"'
; Because the UNINSTALL.LOG_UPDATE_INSTALL macro is responsible for writing the .dat
; it is important to set $InstDir to the directory you want it to be located in.
; This must be done as the last step in your last Section so that $InstDir has
; the correct path when .onInstSuccess is executed.
SetOutPath "$InstDir\bar" ; Make sure the directory exists
StrCpy $InstDir "$InstDir\bar"
SectionEnd
Section UnInstall
; In the uninstaller the initial value of $InstDir is the folder the uninstaller .exe is in.
; In this example I put it in a subfolder so we need to get the root of our install:
GetFullPathname $InstDir "$InstDir\..\"
; This is important, it changes $InstDir to the folder where the .dat is located.
Push $InstDir ; Save
StrCpy $InstDir "$InstDir\bar"
!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
Pop $InstDir ; Restore
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\data"
!insertmacro UNINSTALL.LOG_END_UNINSTALL
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
; Because the uninstaller and the .dat were located in their own (unlogged) folders
; we need to manually delete them:
Delete "$INSTDIR\foo\uninst.exe"
RMDir "$INSTDIR\foo"
Delete "$INSTDIR\bar\${UNINSTALL_LOG}.dat"
RMDir "$INSTDIR\bar"
RMDir "$INSTDIR"
SectionEnd
AdvUninstLog.nsh를 수정 하시겠습니까? 그것은 아마도 수정없이 할 수 있지만 그것은 더 많은 작업이 될 것입니다 ... – Anders
안녕하세요 앤더스 - 그래 나는 AdvUninstLog.nsh을 수정하고자하며 그것을 들여다 보았지만 어디서부터 시작해야할지 모른다. 의견이 있으십니까? (이 토론을위한 적절한 포럼이 아닌 경우 적절한 장소로 나를 리디렉션하십시오.) –