aboutsummaryrefslogtreecommitdiff
path: root/project/Win32BuildSetup
diff options
context:
space:
mode:
authorMartijn Kaijser <mcm.kaijser@gmail.com>2014-09-13 15:12:14 +0200
committerMartijn Kaijser <mcm.kaijser@gmail.com>2014-09-14 17:02:56 +0200
commite3823d6ae608e4547639889972083118d7acdbd2 (patch)
tree058fe47f54720120a8b418f784ef2883f220f731 /project/Win32BuildSetup
parent1a2c59856ba8a5917bb1b7bb363831a1d47a42ce (diff)
[WIN32] Compile, install and run as Kodi. Move old XBMC portable_data and %appdata%/userdata to Kodi locations
Diffstat (limited to 'project/Win32BuildSetup')
-rw-r--r--project/Win32BuildSetup/BuildSetup.bat4
-rw-r--r--project/Win32BuildSetup/genNsisInstaller.nsi (renamed from project/Win32BuildSetup/XBMC for Windows.nsi)46
2 files changed, 37 insertions, 13 deletions
diff --git a/project/Win32BuildSetup/BuildSetup.bat b/project/Win32BuildSetup/BuildSetup.bat
index a8d3989aba..31e37d99a4 100644
--- a/project/Win32BuildSetup/BuildSetup.bat
+++ b/project/Win32BuildSetup/BuildSetup.bat
@@ -10,8 +10,6 @@ REM read the version values from version.txt
FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/APP_NAME/ {print $2}" %base_dir%\version.txt') DO SET APP_NAME=%%i
FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/COMPANY_NAME/ {print $2}" %base_dir%\version.txt') DO SET COMPANY=%%i
FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/WEBSITE/ {print $2}" %base_dir%\version.txt') DO SET WEBSITE=%%i
-rem Temporary set back to XBMC due to compiling
-SET APP_NAME=XBMC
rem ----Usage----
rem BuildSetup [clean|noclean]
@@ -305,7 +303,7 @@ set WORKSPACE=%CD%\..\..
)
SET NSISExe=%NSISExePath%\makensis.exe
- "%NSISExe%" /V1 /X"SetCompressor /FINAL lzma" /Dapp_root="%CD%\BUILD_WIN32" /DAPP_NAME="%APP_NAME%" /DCOMPANY="%COMPANY%" /DWEBSITE="%WEBSITE%" /Dapp_revision="%GIT_REV%" /Dapp_target="%target%" /Dapp_branch="%BRANCH%" "XBMC for Windows.nsi"
+ "%NSISExe%" /V1 /X"SetCompressor /FINAL lzma" /Dapp_root="%CD%\BUILD_WIN32" /DAPP_NAME="%APP_NAME%" /DCOMPANY="%COMPANY%" /DWEBSITE="%WEBSITE%" /Dapp_revision="%GIT_REV%" /Dapp_target="%target%" /Dapp_branch="%BRANCH%" "genNsisInstaller.nsi"
IF NOT EXIST "%APP_SETUPFILE%" (
set DIETEXT=Failed to create %APP_SETUPFILE%. NSIS installed?
goto DIE
diff --git a/project/Win32BuildSetup/XBMC for Windows.nsi b/project/Win32BuildSetup/genNsisInstaller.nsi
index a80e25230d..841f8e8237 100644
--- a/project/Win32BuildSetup/XBMC for Windows.nsi
+++ b/project/Win32BuildSetup/genNsisInstaller.nsi
@@ -87,7 +87,7 @@ InstType "Minimal" ; 3.
;--------------------------------
;Installer Sections
-Section "XBMC" SecAPP
+Section "${APP_NAME}" SecAPP
SetShellVarContext current
SectionIn RO
SectionIn 1 2 3 #section is in install type Normal/Full/Minimal
@@ -113,6 +113,26 @@ Section "XBMC" 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
@@ -142,7 +162,10 @@ Section "XBMC" SecAPP
WriteINIStr "$SMPROGRAMS\$StartMenuFolder\Visit ${APP_NAME} Online.url" "InternetShortcut" "URL" "${WEBSITE}"
!insertmacro MUI_STARTMENU_WRITE_END
-
+
+ ;Remove old XBMC shortcuts
+ RMDir /r "$SMPROGRAMS\XBMC"
+
;add entry to add/remove programs
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" \
"DisplayName" "${APP_NAME}"
@@ -162,7 +185,7 @@ Section "XBMC" SecAPP
"HelpLink" "${WEBSITE}"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" \
"URLInfoAbout" "${WEBSITE}"
-
+
SectionEnd
;*-addons.nsi are generated by genNsisIncludes.bat
@@ -231,16 +254,19 @@ Section "Uninstall"
RMDir /r "$INSTDIR\sounds"
RMDir /r "$INSTDIR\system"
-;Uninstall User Data if option is checked, otherwise skip
+ ;Un-install User Data if option is checked, otherwise skip
${If} $UnPageProfileCheckbox_State == ${BST_CHECKED}
- RMDir /r "$INSTDIR"
RMDir /r "$APPDATA\${APP_NAME}\"
+ RMDir /r "$INSTDIR\portable_data\"
${Else}
-;Even if userdata is kept in %appdata%\xbmc\userdata, the $INSTDIR\userdata should be cleaned up on uninstall if not used
-;If guisettings.xml exists in the XBMC\userdata directory, do not delete XBMC\userdata directory
-;If that file does not exists, then delete that folder and $INSTDIR
- IfFileExists $INSTDIR\userdata\guisettings.xml +2
- RMDir /r "$INSTDIR"
+ ;Check if %appdata%\${APP_NAME}\userdata and portable_data contain no guisettings.xml
+ ;If that file does not exists, then delete those folders and $INSTDIR
+ IfFileExists $INSTDIR\portable_data\userdata\guisettings.xml +2
+ RMDir /r "$INSTDIR\portable_data\"
+ RMDir "$INSTDIR\"
+ IfFileExists "$APPDATA\${APP_NAME}\userdata\guisettings.xml" +2
+ RMDir /r "$APPDATA\${APP_NAME}\userdata\"
+ RMDir "$APPDATA\${APP_NAME}"
${EndIf}
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder