X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=vlc.win32.nsi;h=64f9388fc4cdf0f69cd3989d12ba48fc486e57fb;hb=53e8222b87b6ae4f94daa402ff9e55567adab2d6;hp=04e323ea46a38426f327b9db73a951693a3fa663;hpb=2ef347a1ff6149aa82d6fcf34fe40223f20b7450;p=vlc diff --git a/vlc.win32.nsi b/vlc.win32.nsi index 04e323ea46..64f9388fc4 100644 --- a/vlc.win32.nsi +++ b/vlc.win32.nsi @@ -21,9 +21,13 @@ Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile ..\vlc-${VERSION}-win32.exe InstallDir "$PROGRAMFILES\VideoLAN\VLC" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir" +!ifdef NSIS_LZMA_COMPRESS_WHOLE SetCompressor lzma -ShowInstDetails show -ShowUnInstDetails show +!else +SetCompressor /SOLID lzma +!endif +;ShowInstDetails show +;ShowUnInstDetails show SetOverwrite ifnewer CRCCheck on @@ -35,44 +39,72 @@ InstType "Full" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MUI 1.67 compatible ------ -!include "MUI.nsh" + !include "MUI.nsh" ; MUI Settings -!define MUI_ABORTWARNING -!define MUI_ICON "vlc48x48new.ico" -!define MUI_UNICON "vlc48x48new.ico" -!define MUI_COMPONENTSPAGE_SMALLDESC - -; Welcome page -!insertmacro MUI_PAGE_WELCOME -; License page -!insertmacro MUI_PAGE_LICENSE "COPYING.txt" -; Components page -!insertmacro MUI_PAGE_COMPONENTS -; Directory page -!insertmacro MUI_PAGE_DIRECTORY -; Instfiles page -!insertmacro MUI_PAGE_INSTFILES -; Finish page -!define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe" -!define MUI_FINISHPAGE_NOREBOOTSUPPORT -!insertmacro MUI_PAGE_FINISH + !define MUI_ABORTWARNING + !define MUI_ICON "vlc48x48.ico" + !define MUI_UNICON "vlc48x48.ico" + !define MUI_COMPONENTSPAGE_SMALLDESC + +; Installer pages + ; Welcome page + !define MUI_WELCOMEPAGE_TITLE_3LINES + !insertmacro MUI_PAGE_WELCOME + ; License page + !insertmacro MUI_PAGE_LICENSE "COPYING.txt" + ; Components page + !insertmacro MUI_PAGE_COMPONENTS + ; Directory page + !insertmacro MUI_PAGE_DIRECTORY + ; Instfiles page + !insertmacro MUI_PAGE_INSTFILES + ; Finish page + !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe" + !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt" + !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website" + !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/" + !define MUI_FINISHPAGE_NOREBOOTSUPPORT + !insertmacro MUI_PAGE_FINISH ; Uninstaller pages -!insertmacro MUI_UNPAGE_INSTFILES + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_COMPONENTS + !insertmacro MUI_UNPAGE_INSTFILES + !insertmacro MUI_UNPAGE_FINISH ; Language files -!insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "English" # first language is the default language + !insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Korean" + !insertmacro MUI_LANGUAGE "Italian" + !insertmacro MUI_LANGUAGE "Dutch" + !insertmacro MUI_LANGUAGE "Danish" + !insertmacro MUI_LANGUAGE "Swedish" + !insertmacro MUI_LANGUAGE "Norwegian" + !insertmacro MUI_LANGUAGE "Finnish" + !insertmacro MUI_LANGUAGE "Greek" + !insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "Portuguese" + !insertmacro MUI_LANGUAGE "Arabic" + +!insertmacro MUI_RESERVEFILE_LANGDLL ; Reserve files -!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ; MUI end ------ +;;;;;;;;;;;;;;;;;;; +; Extension lists ; +;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Push extensions on stack ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;; !macro MacroAudioExtensions _action !insertmacro ${_action} ".a52" !insertmacro ${_action} ".aac" @@ -162,6 +194,7 @@ FunctionEnd !macro RegisterExtensionSection EXT Section /o ${EXT} + SectionIn 2 3 Push $R0 StrCpy $R0 ${EXT} Call RegisterExtension @@ -197,6 +230,30 @@ FunctionEnd DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC !macroend +;;;;;;;;;;;;;;;;;;;;;;;;;; +; Delete prefs and cache ; +;;;;;;;;;;;;;;;;;;;;;;;;;; + +!macro delprefs + SectionIn 2 3 + StrCpy $0 0 + !define Index 'Line${__LINE__}' + "${Index}-Loop:" + ; FIXME + ; this will loop through all the logged users and "virtual" windows users + ; (it looks like users are only present in HKEY_USERS when they are logged in) + ClearErrors + EnumRegKey $1 HKU "" $0 + StrCmp $1 "" "${Index}-End" + IntOp $0 $0 + 1 + ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData + StrCmp $2 "" "${Index}-Loop" + RMDir /r "$2\vlc" + Goto "${Index}-Loop" + "${Index}-End:" + !undef Index +!macroend + ;;;;;;;;;;;;;;;;;;;;;; ; Installer sections ; ;;;;;;;;;;;;;;;;;;;;;; @@ -212,6 +269,7 @@ Section "Media player (required)" SEC01 File /r plugins File /r locale + File /r osdmenu File /r skins File /r http @@ -246,7 +304,7 @@ Section "Media player (required)" SEC01 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie" WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play" WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \ - '$INSTDIR\vlc.exe dvd:%1@1:0' + '$INSTDIR\vlc.exe dvd:%1' WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio" WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play" @@ -256,19 +314,17 @@ Section "Media player (required)" SEC01 SectionEnd -Section "Start Menu + Desktop Shortcut" SEC02 +Section "Start Menu Shortcut" SEC02a SectionIn 1 2 3 CreateDirectory "$SMPROGRAMS\VideoLAN" CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \ - "$INSTDIR\vlc.exe" "--intf wxwin --wxwin-embed" + "$INSTDIR\vlc.exe" "--intf wx --wx-embed" CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (alt).lnk" \ - "$INSTDIR\vlc.exe" "--intf wxwin --no-wxwin-embed" + "$INSTDIR\vlc.exe" "--intf wx --no-wx-embed" CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \ "$INSTDIR\vlc.exe" "--intf skins" CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC defaults and quit.lnk" \ "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit " - CreateShortCut "$DESKTOP\VLC media player.lnk" \ - "$INSTDIR\vlc.exe" "--intf wxwin" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \ "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_NAME} Website.lnk" \ @@ -279,6 +335,12 @@ Section "Start Menu + Desktop Shortcut" SEC02 "$INSTDIR\Documentation.url" SectionEnd +Section "Desktop Shortcut" SEC02b + SectionIn 1 2 3 + CreateShortCut "$DESKTOP\VLC media player.lnk" \ + "$INSTDIR\vlc.exe" "--intf wx" +SectionEnd + Section /o "Mozilla plugin" SEC03 SectionIn 2 3 File /r mozilla @@ -327,6 +389,7 @@ SectionEnd Section "Context Menus" SEC05 SectionIn 1 2 3 !insertmacro MacroAllExtensions AddContextMenu + !insertmacro AddContextMenu "Folder" SectionEnd SectionGroup "File type associations" SEC06 @@ -341,6 +404,48 @@ SectionGroup "File type associations" SEC06 SectionGroupEnd SectionGroupEnd +Section /o "Delete preferences and cache" SEC07 + !insertmacro delprefs +SectionEnd + +; Installer section descriptions +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \ + "The media player itself" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \ + "Adds icons to your start menu for easy access" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \ + "Adds icon to your desktop for easy access" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \ + "The VLC Mozilla and Mozilla Firefox plugin" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \ + "The VLC ActiveX plugin" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \ + "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \ + "Sets VLC media player as the default application for the specified file type" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \ + "Deletes VLC media player preferences and cache files leftover from previous installations" +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +Function .onInit + ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \ + "UninstallString" + StrCmp $R0 "" done + + MessageBox MB_YESNO|MB_ICONEXCLAMATION \ + "VLC media player has already been installed. $\nDo you want to remove \ + the previous version before installing $(^Name) ?" \ + IDNO done + + ;Run the uninstaller + ;uninst: + ClearErrors + ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + done: + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + Section -Post WriteUninstaller "$INSTDIR\uninstall.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR @@ -361,40 +466,17 @@ Section -Post "Publisher" "${PRODUCT_PUBLISHER}" SectionEnd -; Section descriptions -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \ - "The media player itself" - !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} \ - "Adds icons to your start menu and your desktop for easy access" - !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \ - "The VLC Mozilla and Mozilla Firefox plugin" - !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \ - "The VLC ActiveX plugin" - !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \ - "Add context menu items (Play With VLC and Add To VLC's Playlist)" - !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \ - "Sets VLC media player as the default application for the specified file type" -!insertmacro MUI_FUNCTION_DESCRIPTION_END - - -Function un.onUninstSuccess - HideWindow - MessageBox MB_ICONINFORMATION|MB_OK \ - "$(^Name) was successfully removed from your computer." -FunctionEnd - -Function un.onInit - MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \ - "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 - Abort -FunctionEnd +;;;;;;;;;;;;;;;;;;;;;;;; +; Uninstaller sections ; +;;;;;;;;;;;;;;;;;;;;;;;; -Section Uninstall +Section "Uninstall" SEC91 + SectionIn 1 2 3 RO SetShellVarContext all !insertmacro MacroAllExtensions DeleteContextMenu !insertmacro MacroAllExtensions UnRegisterExtensionSection + !insertmacro DeleteContextMenu "Folder" UnRegDLL "$INSTDIR\axvlc.dll" Delete /REBOOTOK "$INSTDIR\axvlc.dll" @@ -449,3 +531,25 @@ Section Uninstall DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" SetAutoClose true SectionEnd + +Section /o "un.Delete preferences and cache" SEC92 + !insertmacro delprefs +SectionEnd + +; Uninstaller section descriptions +!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \ + "Uninstall VLC media player and all its components" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \ + "Deletes VLC media player preferences and cache files" +!insertmacro MUI_UNFUNCTION_DESCRIPTION_END + +;Function un.onUninstSuccess +; HideWindow +; MessageBox MB_ICONINFORMATION|MB_OK \ +; "$(^Name) was successfully removed from your computer." +;FunctionEnd + +Function un.onInit + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd