PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/project/Win32BuildSetup/genNsisIncludes.bat

http://github.com/xbmc/xbmc
Batch | 158 lines | 146 code | 12 blank | 0 comment | 2 complexity | 07eef0aeae34ccb8497938d7ea5a69ad MD5 | raw file
  1@ECHO OFF
  2rem Application for Windows install script
  3rem Copyright (C) 2005-2015 Team XBMC
  4rem http://kodi.tv
  5
  6rem Script by chadoe
  7rem This script generates NullSoft NSIS installer include files for application's add-ons
  8rem "SectionIn" defines on what level the section is selected by default
  9rem 1. Full / 2. Normal  / 3. Minimal
 10
 11IF EXIST *-addons.nsi del *-addons.nsi > NUL
 12SETLOCAL ENABLEDELAYEDEXPANSION
 13
 14SET Counter=1
 15IF EXIST BUILD_WIN32\addons\pvr.* (
 16  ECHO SectionGroup "PVR Add-ons" SecPvrAddons >> pvr-addons.nsi
 17  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\pvr.*') DO (
 18    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
 19      ECHO Section "%%N" SecPvrAddons!Counter! >> pvr-addons.nsi
 20      ECHO SectionIn 1 2 >> pvr-addons.nsi
 21      ECHO SetOutPath "$INSTDIR\addons\%%P" >> pvr-addons.nsi
 22      ECHO File /r "${app_root}\addons\%%P\*.*" >> pvr-addons.nsi
 23      ECHO SectionEnd >> pvr-addons.nsi
 24      SET /A Counter = !Counter! + 1
 25      )
 26    )
 27  ECHO SectionGroupEnd >> pvr-addons.nsi
 28)
 29
 30SET Counter=1
 31IF EXIST BUILD_WIN32\addons\game.libretro.* (
 32  ECHO SectionGroup "Game Add-ons" SecGameAddons >> game-addons.nsi
 33  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\game.libretro.*') DO (
 34    FOR /f "delims=<" %%N in ('powershell.exe -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
 35      ECHO Section "%%N" SecGameAddons!Counter! >> game-addons.nsi
 36      ECHO SectionIn 1 2 >> game-addons.nsi
 37      ECHO SetOutPath "$INSTDIR\addons\%%P" >> game-addons.nsi
 38      ECHO File /r "${app_root}\addons\%%P\*.*" >> game-addons.nsi
 39      ECHO SectionEnd >> game-addons.nsi
 40      SET /A Counter = !Counter! + 1
 41      )
 42    )
 43  ECHO SectionGroupEnd >> game-addons.nsi
 44)
 45
 46SET Counter=1
 47IF EXIST BUILD_WIN32\addons\audiodecoder.* (
 48  ECHO SectionGroup "Audio Decoder Add-ons" SecAudioDecoderAddons >> audiodecoder-addons.nsi
 49  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\audiodecoder.*') DO (
 50    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
 51      ECHO Section "%%N" SecAudioDecoderAddons!Counter! >> audiodecoder-addons.nsi
 52      ECHO SectionIn 1 >> audiodecoder-addons.nsi
 53      ECHO SetOutPath "$INSTDIR\addons\%%P" >> audiodecoder-addons.nsi
 54      ECHO File /r "${app_root}\addons\%%P\*.*" >> audiodecoder-addons.nsi
 55      ECHO SectionEnd >> audiodecoder-addons.nsi
 56      SET /A Counter = !Counter! + 1
 57      )
 58    )
 59  ECHO SectionGroupEnd >> audiodecoder-addons.nsi
 60)
 61
 62SET Counter=1
 63IF EXIST BUILD_WIN32\addons\audioencoder.* (
 64  ECHO SectionGroup "Audio Encoder Add-ons" SecAudioEncoderAddons >> audioencoder-addons.nsi
 65  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\audioencoder.*') DO (
 66    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
 67      ECHO Section "%%N" SecAudioEncoderAddons!Counter! >> audioencoder-addons.nsi
 68      ECHO SectionIn 1 2 3 >> audioencoder-addons.nsi
 69      ECHO SetOutPath "$INSTDIR\addons\%%P" >> audioencoder-addons.nsi
 70      ECHO File /r "${app_root}\addons\%%P\*.*" >> audioencoder-addons.nsi
 71      ECHO SectionEnd >> audioencoder-addons.nsi
 72      SET /A Counter = !Counter! + 1
 73      )
 74    )
 75  ECHO SectionGroupEnd >> audioencoder-addons.nsi
 76)
 77
 78SET Counter=1
 79IF EXIST BUILD_WIN32\addons\screensaver.* (
 80  ECHO SectionGroup "Screensaver Add-ons" SecScreensaverAddons >> screensaver-addons.nsi
 81  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\screensaver.*') DO (
 82    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
 83      ECHO Section "%%N" SecScreensaverAddons!Counter! >> screensaver-addons.nsi
 84      ECHO SectionIn 1 2 3 >> screensaver-addons.nsi
 85      ECHO SetOutPath "$INSTDIR\addons\%%P" >> screensaver-addons.nsi
 86      ECHO File /r "${app_root}\addons\%%P\*.*" >> screensaver-addons.nsi
 87      ECHO SectionEnd >> screensaver-addons.nsi
 88      SET /A Counter = !Counter! + 1
 89      )
 90    )
 91  ECHO SectionGroupEnd >> screensaver-addons.nsi
 92)
 93
 94SET Counter=1
 95IF EXIST BUILD_WIN32\addons\imagedecoder.* (
 96  ECHO SectionGroup "Image decoder Add-ons" SecImageDecoderAddons >> imagedecoder-addons.nsi
 97  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\imagedecoder.*') DO (
 98    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
 99      ECHO Section "%%N" SecImageDecoderAddons!Counter! >> imagedecoder-addons.nsi
100      ECHO SectionIn 1 2 3 >> imagedecoder-addons.nsi
101      ECHO SetOutPath "$INSTDIR\addons\%%P" >> imagedecoder-addons.nsi
102      ECHO File /r "${app_root}\addons\%%P\*.*" >> imagedecoder-addons.nsi
103      ECHO SectionEnd >> imagedecoder-addons.nsi
104      SET /A Counter = !Counter! + 1
105      )
106    )
107  ECHO SectionGroupEnd >> imagedecoder-addons.nsi
108)
109
110SET Counter=1
111IF EXIST BUILD_WIN32\addons\vfs.* (
112  ECHO SectionGroup "VFS Add-ons" SecVFSAddons >> vfs-addons.nsi
113  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\vfs.*') DO (
114    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
115      ECHO Section "%%N" SecVFSAddons!Counter! >> vfs-addons.nsi
116      ECHO SectionIn 1 2 3 >> vfs-addons.nsi
117      ECHO SetOutPath "$INSTDIR\addons\%%P" >> vfs-addons.nsi
118      ECHO File /r "${app_root}\addons\%%P\*.*" >> vfs-addons.nsi
119      ECHO SectionEnd >> vfs-addons.nsi
120      SET /A Counter = !Counter! + 1
121      )
122    )
123  ECHO SectionGroupEnd >> vfs-addons.nsi
124)
125
126SET Counter=1
127IF EXIST BUILD_WIN32\addons\visualization.* (
128  ECHO SectionGroup "Visualization Add-ons" SecVisualizationAddons >> visualization-addons.nsi
129  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\visualization.*') DO (
130    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
131      ECHO Section "%%N" SecVisualizationAddons!Counter! >> visualization-addons.nsi
132      ECHO SectionIn 1 2 3 >> visualization-addons.nsi
133      ECHO SetOutPath "$INSTDIR\addons\%%P" >> visualization-addons.nsi
134      ECHO File /r "${app_root}\addons\%%P\*.*" >> visualization-addons.nsi
135      ECHO SectionEnd >> visualization-addons.nsi
136      SET /A Counter = !Counter! + 1
137      )
138    )
139  ECHO SectionGroupEnd >> visualization-addons.nsi
140)
141
142SET Counter=1
143IF EXIST BUILD_WIN32\addons\inputstream.* (
144  ECHO SectionGroup "Inputstream Add-ons" SecInputstreamAddons >> inputstream-addons.nsi
145  FOR /F "tokens=*" %%P IN ('dir /B /AD BUILD_WIN32\addons\inputstream.*') DO (
146    FOR /f "delims=<" %%N in ('powershell.exe -noprofile -ExecutionPolicy Unrestricted -command "& {[xml]$a = get-content BUILD_WIN32\addons\%%P\addon.xml;$a.addon.name}"') do (
147      ECHO Section "%%N" SecInputstreamAddons!Counter! >> inputstream-addons.nsi
148      ECHO SectionIn 1 2 >> inputstream-addons.nsi
149      ECHO SetOutPath "$INSTDIR\addons\%%P" >> inputstream-addons.nsi
150      ECHO File /r "${app_root}\addons\%%P\*.*" >> inputstream-addons.nsi
151      ECHO SectionEnd >> inputstream-addons.nsi
152      SET /A Counter = !Counter! + 1
153      )
154    )
155  ECHO SectionGroupEnd >> inputstream-addons.nsi
156)
157
158ENDLOCAL