; Installazione, template generico !include "MUI.nsh" SetCompressor LZMA Var MUI_TEMP Var STARTMENU_FOLDER !define MUI_ABORTWARNING !define MUI_ICON "icon.ico" !define MUI_WELCOMEPAGE_TITLE "Installazione di $(^Name)" !define MUI_WELCOMEFINISHPAGE_BITMAP "inst_image.bmp" !define MUI_WELCOMEPAGE_TEXT "$(^Name)\r\n\r\nUn'avventura interattiva\r\ndi Autore, 2010.\r\n\r\n$_CLICK" !insertmacro MUI_PAGE_WELCOME !define MUI_STARTMENUPAGE_DEFAULTFOLDER "CartellaMenuAvvio" !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_LANGUAGE "Italian" Name "Avventura" OutFile "Avventura_Setup.exe" InstallDir "$PROGRAMFILES\Directory" ShowInstDetails show ShowUnInstDetails show BrandingText "Avventura" Section -Files SetOutPath "$INSTDIR\" File "avventura.gblorb" File "avventura.ini" File "manuale.pdf" File "icon.ico" File "pathgargoyle\*.dll" File "pathgargoyle\glulxe.exe" File "pathgargoyle\frotz.exe" File "pathgargoyle\gnu general public license.txt" FILE "pathgargoyle\luxi license.txt" SectionEnd Section -Icons !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Avventura.lnk" "$INSTDIR\glulxe.exe" '"$INSTDIR\avventura.gblorb"' "$INSTDIR\icon.ico" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Manuale di Avventura.lnk" "$INSTDIR\manuale.pdf" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Disinstalla Avventura.lnk" "$INSTDIR\uninstall.exe" CreateShortCut "$DESKTOP\Avventura.lnk" "$INSTDIR\glulxe.exe" '"$INSTDIR\avventura.gblorb"' $INSTDIR\icon.ico" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section -PostInstall WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ID_Avventura" "DisplayName" "Avventura (rimozione)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ID_Avventura" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "$INSTDIR\uninstall.exe" SectionEnd #### Uninstaller code #### Function un.onInit MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Rimuovere $(^Name) ?" IDYES +2 Abort FunctionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) è stato rimosso." FunctionEnd Section Uninstall !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP Delete "$SMPROGRAMS\$MUI_TEMP\Avventura.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Manuale di Avventura.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Disinstalla Avventura.lnk" RMDir "$SMPROGRAMS\$MUI_TEMP\" RMDir "$SMPROGRAMS\$MUI_TEMP\..\" Delete "$DESKTOP\Avventura.lnk" RMDir /r "$INSTDIR" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ID_Avventura" SectionEnd