@echo off
:: Nero Custom Installation Builder 1.1
:: Copyright 2005 `felix`
:: Last updated: March 5, 2005
:: Credit to ZileXa @ MSFN for his guide that made
:: this process possible. for more information -
::
http://www.msfn.org/board/index.php?showto...ndpost&p=254796
:: This batch file will create a Custom installation of Nero
:: During the creation process all unrequired files will be
:: stripped to assist in reducing the final file size.
:: Make sure we are running Windows NT or Above.
IF NOT %OS%==Windows_NT GOTO:EOF
setlocal
TITLE Nero Custom Installation Builder 1.1
mode con cols=70 lines=3 & color 1f
:: setup the variables
set TmpPath=
nerotmp
:: If you don't have WinRAR in the default location, change it below.
set rarIt=
%programfiles%\winrar\winrar.exe
set installerName=
Custom_Nero
:: Check to make sure WinRAR is available
IF /I not exist "%rarIt%" cls & echo. & echo WinRAR can not be found, aboarding... & goto:eof
:: If custom installer exists in the current directory rename it
if exist "%installerName%.old" del "%installerName%.old"
if exist "%installerName%.exe" ren "%installerName%.exe" "%installerName%.old"
:: Check that Nero is in the current folder and
:: Extract it to %TmpPath%
if exist "Nero-*" for %%i in ("Nero-*.exe" "NVE-*.exe") do call:extract %%i
:: Copy the post installation files for the final installer
xcopy /q /y post_config.cmd %TmpPath% >NUL 2>&1 & xcopy /q /y register.reg %TmpPath% >NUL 2>&1 & xcopy /q /y shortcut.exe %TmpPath% >NUL 2>&1
cd %TmpPath%
:: Listed below is the features that will be included in the
:: custom build. To add additional feature simply add them to
:: the list in quote as seen here... and also remember to remove
:: them from the stripIt section below.
for %%i in (
"CoverDesigner" "Nero" "Nero Toolkit" "Nero Recode" "Nero ShowTime") do call:stripIt %%i
cd ..
:: Now build the installer
call:buildIt
rem mode con cols=80 lines=300 & color 0a
endlocal
exit
GOTO:EOF
:stripIt
cls
echo.
echo Deleting unrequired files...
:: Listed below are all the folders that will be removed.
:: If you want to included any of these in your installation
:: They must be removed from this list.
for %%i in (
"WMPBurn" "setup" "Redist" "Nero Wave Editor" "NeroVision" "Nero StartSmart" "nero soundtrax" "Nero PhotoSnap" "Nero MediaHome" "Nero BackItUp" "ImageDrive") do rd /s /q %%i >NUL
:: Delete unrequired files.
for %%i in ("VersionInfo.txt" "Setup.exe" "Setup.cfg") do del /f /q %%i >NUL
:: Rename the install files to correct targets
ren "common files" Ahead >NUL
ren System System32 >NUL
:: Move the base source files to the correct targets
xcopy /s /i /q /y /k "System32" "Windows\System32" >NUL & rd /s /q "System32" >NUL
xcopy /s /i /q /y /k "Ahead" "Program Files\Common Files\Ahead" >NUL & rd /s /q "Ahead" >NUL
:: Moves All the wanted Nero Features to the right folder
cls
echo.
echo Now moving %1 to target locations...
xcopy /s /i /q /y /k "%~1" "Program Files\Ahead\%~1" >NUL & rd /s /q "%~1" >NUL
GOTO:EOF
:extract
cls
echo.
echo Extracting "%1" to "%TmpPath%", please be patient...
"%rarit%" X -IBCK -o+ "%1" "%cd%\%TmpPath%\" >NUL
GOTO:EOF
:buildIt
cls
echo.
echo Now creating the "%installerName%" installer - nearly finished...
"%rarit%" a -ep1 -IBCK -zcomment.txt -m5 -o+ -r -s -sfxNERO.SFX "%installerName%" %TmpPath%\*.*
:: After archiving, remove the tmp source.
ping -n 4 127.0.0.1 >NUL
rd /s /q %TmpPath% >NUL
GOTO:EOF
:EOF