diff options
author | Martijn Kaijser <mcm.kaijser@gmail.com> | 2014-09-21 10:27:03 +0200 |
---|---|---|
committer | Martijn Kaijser <mcm.kaijser@gmail.com> | 2014-09-21 10:27:03 +0200 |
commit | 7fadf974211aee96e61a9b502e3597d9ce9236c1 (patch) | |
tree | 4317002b15c5cf93866dda8711fbd83d2bb13976 /project | |
parent | f02ebef7be8b2e61ed3d1cb1ecbada940269174d (diff) |
[win32] fix detection of old XBMC install and remove XBMC regkeys
Diffstat (limited to 'project')
-rw-r--r-- | project/Win32BuildSetup/genNsisInstaller.nsi | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/project/Win32BuildSetup/genNsisInstaller.nsi b/project/Win32BuildSetup/genNsisInstaller.nsi index 841f8e8237..387bc7ed1a 100644 --- a/project/Win32BuildSetup/genNsisInstaller.nsi +++ b/project/Win32BuildSetup/genNsisInstaller.nsi @@ -91,6 +91,33 @@ Section "${APP_NAME}" SecAPP SetShellVarContext current SectionIn RO SectionIn 1 2 3 #section is in install type Normal/Full/Minimal + + ;Move XBMC portable_data and appdata folder if exists to new location + ;and safe clean out old install folder + Var /GLOBAL INSTDIR_OLD + ReadRegStr $INSTDIR_OLD HKCU "Software\XBMC" "" + ${IfNot} $INSTDIR_OLD == "" + IfFileExists "$APPDATA\XBMC\*.*" 0 +2 + Rename "$APPDATA\XBMC\" "$APPDATA\${APP_NAME}\" + + ${IfNot} $INSTDIR_OLD == $INSTDIR + IfFileExists $INSTDIR_OLD\portable_data\*.* 0 +3 + Rename "$INSTDIR_OLD\portable_data\" "$INSTDIR\portable_data\" + MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Your current XBMC portable_data folder was moved to the new installation folder.$\nPlease manually adjust the short-cut for starting ${APP_NAME} accordingly." + + RMDir /r "$INSTDIR_OLD\addons" + RMDir /r "$INSTDIR_OLD\language" + RMDir /r "$INSTDIR_OLD\media" + RMDir /r "$INSTDIR_OLD\sounds" + RMDir /r "$INSTDIR_OLD\system" + RMDir /r "$INSTDIR_OLD\userdata" + Delete "$INSTDIR_OLD\*.*" + RMDir "$INSTDIR_OLD" + ${EndIf} + DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\XBMC" + DeleteRegKey HKCU "Software\XBMC" + ${EndIf} + ;Clean up install folder RMDir /r $INSTDIR\addons RMDir /r $INSTDIR\language @@ -113,26 +140,6 @@ Section "${APP_NAME}" SecAPP SetOutPath "$INSTDIR\system" File /r "${app_root}\application\system\*.*" - ;Move XBMC portable_data and appdata folder if exists to new location - ;and safe clean out old install folder - Var /GLOBAL INSTDIR_OLD - ReadRegStr $INSTDIR_OLD HKCU "Software\XBMC" "" - ${IfNot} $INSTDIR_OLD == "" - IfFileExists $INSTDIR_OLD\portable_data\*.* 0 +2 - Rename "$INSTDIR_OLD\portable_data\" "$INSTDIR\portable_data\" - MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Your current XBMC portable_data folder was moved to the new installation folder.$\nPlease manually adjust the short-cut for starting ${APP_NAME} accordingly." - IfFileExists "$APPDATA\XBMC\*.*" 0 +1 - Rename "$APPDATA\XBMC\" "$APPDATA\${APP_NAME}\" - RMDir /r "$INSTDIR_OLD\addons" - RMDir /r "$INSTDIR_OLD\language" - RMDir /r "$INSTDIR_OLD\media" - RMDir /r "$INSTDIR_OLD\sounds" - RMDir /r "$INSTDIR_OLD\system" - RMDir /r "$INSTDIR_OLD\userdata" - Delete "$INSTDIR_OLD\*.*" - RMDir "$INSTDIR_OLD" - ${EndIf} - ;Turn off overwrite to prevent files in APPDATA\xbmc\userdata\ from being overwritten SetOverwrite off IfFileExists $INSTDIR\userdata\*.* 0 +2 @@ -247,12 +254,12 @@ Section "Uninstall" SetShellVarContext current ;ADD YOUR OWN FILES HERE... - Delete "$INSTDIR\*.*" RMDir /r "$INSTDIR\addons" RMDir /r "$INSTDIR\language" RMDir /r "$INSTDIR\media" RMDir /r "$INSTDIR\sounds" RMDir /r "$INSTDIR\system" + Delete "$INSTDIR\*.*" ;Un-install User Data if option is checked, otherwise skip ${If} $UnPageProfileCheckbox_State == ${BST_CHECKED} @@ -268,6 +275,7 @@ Section "Uninstall" RMDir /r "$APPDATA\${APP_NAME}\userdata\" RMDir "$APPDATA\${APP_NAME}" ${EndIf} + RMDir "$INSTDIR" !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder Delete "$SMPROGRAMS\$StartMenuFolder\${APP_NAME}.lnk" |