Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;NSIS Modern User Interface
- ;Start Menu Folder Selection Example Script
- ;Written by Joost Verburg
- ;--------------------------------
- ;Include Modern UI
- !include "MUI2.nsh"
- !define MUI_ICON "TouHouFM/touhou.ico"
- ;--------------------------------
- ;General
- ;Name and file
- Name "TouHouFM Desktop Player"
- OutFile "TouHouFM.exe"
- ;Default installation folder
- InstallDir "$PROGRAMFILES\TouHou.FM"
- ;Get installation folder from registry if available
- InstallDirRegKey HKCU "Software\TouHou.FM" ""
- ;Request application privileges for Windows Vista
- RequestExecutionLevel admin
- ;--------------------------------
- ;Variables
- Var StartMenuFolder
- ;--------------------------------
- ;Interface Settings
- !define MUI_ABORTWARNING
- ;--------------------------------
- ;Pages
- !insertmacro MUI_PAGE_COMPONENTS
- !insertmacro MUI_PAGE_DIRECTORY
- ;Start Menu Folder Page Configuration
- !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
- !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\TouHou.FM"
- !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
- !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
- ;--------------------------------
- ;Languages
- !insertmacro MUI_LANGUAGE "English"
- ;--------------------------------
- ;Installer Sections
- Section "TouHouFM" SecPlayer
- SectionIn RO
- SetOutPath "$INSTDIR"
- File /r /x skins TouHouFM\*
- ;ADD YOUR OWN FILES HERE...
- ;Store installation folder
- WriteRegStr HKCU "Software\TouHou.FM" "" $INSTDIR
- ;Create uninstaller
- WriteUninstaller "$INSTDIR\Uninstall.exe"
- !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
- ;Create shortcuts
- CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
- CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
- CreateShortcut "$SMPROGRAMS\$StartMenuFolder\TouHouFM.lnk" "$INSTDIR\TouHouFM.exe" "$INSTDIR\touhou.ico"
- !insertmacro MUI_STARTMENU_WRITE_END
- SectionEnd
- Section "Skins" SecSkins
- SetOutPath "$INSTDIR\skins"
- File /r "TouHouFM\skins\*.*"
- SectionEnd
- ;--------------------------------
- ;Descriptions
- ;Language strings
- LangString DESC_SecPlayer ${LANG_ENGLISH} "The player itself."
- LangString DESC_SecSkins ${LANG_ENGLISH} "Extra skins."
- ;Assign language strings to sections
- !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${SecPlayer} $(DESC_SecPlayer)
- !insertmacro MUI_DESCRIPTION_TEXT ${SecSkins} $(DESC_SecSkins)
- !insertmacro MUI_FUNCTION_DESCRIPTION_END
- ;--------------------------------
- ;Uninstaller Section
- Section "Uninstall"
- ;ADD YOUR OWN FILES HERE...
- Delete "$INSTDIR\platforms\*"
- RMDir "$INSTDIR\platforms"
- Delete "$INSTDIR\audio\*"
- RMDir "$INSTDIR\audio"
- Delete "$INSTDIR\mediaservice\*"
- RMDir "$INSTDIR\mediaservice"
- Delete "$INSTDIR\skins\*"
- RMDir "$INSTDIR\skins"
- Delete "$INSTDIR\*"
- RMDir "$INSTDIR"
- !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
- Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
- Delete "$SMPROGRAMS\$StartMenuFolder\TouHouFM.lnk"
- RMDir "$SMPROGRAMS\$StartMenuFolder"
- DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
- SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement