2 rem Application for Windows install script
3 rem Copyright (C) 2005-2015 Team XBMC
7 rem This script generates NullSoft NSIS installer include files for application's add-ons
8 rem "SectionIn" defines on what level the section is selected by default
9 rem 1. Full / 2. Normal / 3. Minimal
11 IF EXIST *-addons.nsi del *-addons.nsi > NUL
12 SETLOCAL ENABLEDELAYEDEXPANSION
15 IF 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
27 ECHO SectionGroupEnd >> pvr-addons.nsi
31 IF 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
43 ECHO SectionGroupEnd >> game-addons.nsi
47 IF 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
59 ECHO SectionGroupEnd >> audiodecoder-addons.nsi
63 IF 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
75 ECHO SectionGroupEnd >> audioencoder-addons.nsi
79 IF 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
91 ECHO SectionGroupEnd >> screensaver-addons.nsi
95 IF 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
107 ECHO SectionGroupEnd >> imagedecoder-addons.nsi
111 IF 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
123 ECHO SectionGroupEnd >> vfs-addons.nsi
127 IF 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
139 ECHO SectionGroupEnd >> visualization-addons.nsi
143 IF 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
155 ECHO SectionGroupEnd >> inputstream-addons.nsi