Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !macro UNINSTBUILDER_GENERATE localbindef unique
- !define __UNBLDR_UNIQ "_UNBLDR${unique}" ;somewhat unique
- !define __UNBLDR_LOCUNBIN "$%temp%\${__UNBLDR_UNIQ}un.exe"
- !if "${localbindef}" != ""
- !define ${localbindef} "${__UNBLDR_LOCUNBIN}"
- !endif
- !appendfile "$%temp%\${__UNBLDR_UNIQ}" '!include "${__FILE__}"$\n'
- !appendfile "$%temp%\${__UNBLDR_UNIQ}" 'outfile "$%temp%\${__UNBLDR_UNIQ}.exe"$\nSilentInstall silent$\nSection$\n'
- !appendfile "$%temp%\${__UNBLDR_UNIQ}" 'WriteUninstaller "$%temp%\${__UNBLDR_UNIQ}un.exe"$\nSectionEnd$\n'
- !system '"${NSISDIR}\MakeNsis.exe" /NOCD /DBUILDUNINSTALLER "$%temp%\${__UNBLDR_UNIQ}"' = 0
- !delfile "$%temp%\${__UNBLDR_UNIQ}"
- !system '"$%temp%\${__UNBLDR_UNIQ}.exe"' = 0
- !delfile "$%temp%\${__UNBLDR_UNIQ}.exe"
- !undef __UNBLDR_UNIQ
- !macroend
- !macro UNINSTBUILDER_WRITE destpath
- File "/oname=${destpath}" "${__UNBLDR_LOCUNBIN}"
- !delfile "${__UNBLDR_LOCUNBIN}"
- !macroend
- !define APPNAME "UninstallerSignTest"
- name "${APPNAME}"
- outfile "$%temp%\${APPNAME}.exe"
- installdir "$temp\untest"
- setcompressor /solid lzma
- VIProductVersion "1.2.3.4"
- VIAddVersionKey "LegalCopyright" "© Fake company"
- VIAddVersionKey "FileDescription" "${APPNAME} desc"
- VIAddVersionKey "FileVersion" "1.2.3"
- !ifNdef BUILDUNINSTALLER
- !insertmacro UNINSTBUILDER_GENERATE localuninst "${APPNAME}"
- !echo "Do something with uninstaller: ${localuninst}"
- VIAddVersionKey "Comments" "Installer"
- page directory
- page instfiles
- Section
- Setoutpath -
- !insertmacro UNINSTBUILDER_WRITE "$instdir\uninstaller.exe"
- MessageBox mb_yesno "Uninstall now?" IDNO nope
- Exec '"$instdir\uninstaller.exe"'
- quit
- nope:
- SectionEnd
- !else
- VIAddVersionKey "Comments" "Uninstaller"
- UninstPage uninstconfirm
- UninstPage instfiles
- Section -un.Uninstaller
- MessageBox mb_ok "Hello from uninstaller"
- Delete "$instdir\uninstaller.exe"
- RMDir "$instdir"
- SectionEnd
- !endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement