make the created .bat files dos linefeed and add an empty line at the end so that cmd.exe is happy

This commit is contained in:
Mario Fetka 2013-08-05 21:31:53 +02:00
parent 5001824b2a
commit 09d4e89d45
2 changed files with 8 additions and 1 deletions

View File

@ -117,7 +117,6 @@ DL_SOURCE[16]="http://download.microsoft.com/download/B/3/C/B3CF6815-40B1-4E36-8
DL_ARCH[16]="X86" DL_ARCH[16]="X86"
DL_WINST_NAME[16]=InstallSilver64Exe DL_WINST_NAME[16]=InstallSilver64Exe
################## ##################
### Uninstallers ### Uninstallers
################## ##################

View File

@ -77,6 +77,7 @@ function create() {
echo "@echo off" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat echo "@echo off" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat
echo "set arch=%1" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat echo "set arch=%1" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat
echo "call %~dp0\%arch%\_Install.bat" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat echo "call %~dp0\%arch%\_Install.bat" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat
echo "" >> $INST_DIR/CLIENT_DATA/Install/NET/3.5/_Install.bat
# Integrate .net for win 8.0 into winpkg # Integrate .net for win 8.0 into winpkg
for NETVER in 2.0 3.0 3.5 for NETVER in 2.0 3.0 3.5
@ -106,6 +107,7 @@ function create() {
echo "SET NETPARENTDIR=%cd%" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat echo "SET NETPARENTDIR=%cd%" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat
echo "echo Installing .NET Framwork $NETVER" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat echo "echo Installing .NET Framwork $NETVER" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat
echo "dism /online /enable-feature /featurename:NetFx3 /All /Source:%NETPARENTDIR%\WIN8.X /LimitAccess" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat echo "dism /online /enable-feature /featurename:NetFx3 /All /Source:%NETPARENTDIR%\WIN8.X /LimitAccess" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat
echo "" >> $INST_DIR/CLIENT_DATA/Install/NET/$NETVER/_Install8X.bat
done done
# sed everything to disabled # sed everything to disabled
@ -139,6 +141,7 @@ function create() {
echo "if exist \"%PROGRAMFILES%\Java\jre7\bin\jqs.exe\" \"%PROGRAMFILES%\Java\jre7\bin\jqs.exe\" -unregister" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat echo "if exist \"%PROGRAMFILES%\Java\jre7\bin\jqs.exe\" \"%PROGRAMFILES%\Java\jre7\bin\jqs.exe\" -unregister" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat
echo "if exist \"%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe\" \"%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe\" -unregister" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat echo "if exist \"%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe\" \"%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe\" -unregister" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat
# echo "REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v SunJavaUpdateSched /f" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat # echo "REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v SunJavaUpdateSched /f" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat
echo "" >> $INST_DIR/CLIENT_DATA/Install/Packages/JRE/disable.bat
sed 's/.*\t<\/install>.*/\t\t<cmd path="disable.bat" name="Disable Java Update Check " \/>\n&/' -i $INST_DIR/CLIENT_DATA/Install/Packages/JRE/package.xml sed 's/.*\t<\/install>.*/\t\t<cmd path="disable.bat" name="Disable Java Update Check " \/>\n&/' -i $INST_DIR/CLIENT_DATA/Install/Packages/JRE/package.xml
# Update Flash # Update Flash
@ -154,8 +157,10 @@ function create() {
sed 's/.*\t<\/install>.*/\t\t<cmd path="disable64.bat" name="Disable Flash Update Check x64" arch="x64" \/>\n<check type="file" condition="notexist" path="%Windir%\\SysWOW64\\Macromed\\Flash\\NPSWF32_%VERSION_FILE%.dll" arch="x64" \/>\n<\/cmd>\n&/' -i $INST_DIR/CLIENT_DATA/Install/Packages/Flash/package.xml sed 's/.*\t<\/install>.*/\t\t<cmd path="disable64.bat" name="Disable Flash Update Check x64" arch="x64" \/>\n<check type="file" condition="notexist" path="%Windir%\\SysWOW64\\Macromed\\Flash\\NPSWF32_%VERSION_FILE%.dll" arch="x64" \/>\n<\/cmd>\n&/' -i $INST_DIR/CLIENT_DATA/Install/Packages/Flash/package.xml
echo "@echo off" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable32.bat echo "@echo off" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable32.bat
echo "copy /y /v \"%~dp0mms.cfg\" \"%WINDIR%\system32\Macromed\Flash\mms.cfg\"" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable32.bat echo "copy /y /v \"%~dp0mms.cfg\" \"%WINDIR%\system32\Macromed\Flash\mms.cfg\"" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable32.bat
echo "" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable32.bat
echo "@echo off" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable64.bat echo "@echo off" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable64.bat
echo "copy /y /v \"%~dp0mms.cfg\" \"%WINDIR%\SysWOW64\Macromed\Flash\mms.cfg\"" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable64.bat echo "copy /y /v \"%~dp0mms.cfg\" \"%WINDIR%\SysWOW64\Macromed\Flash\mms.cfg\"" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable64.bat
echo "" >> $INST_DIR/CLIENT_DATA/Install/Packages/Flash/disable64.bat
# Update Shockwave # Update Shockwave
if [ "$SHOCKUPDATE" = "1" ]; then if [ "$SHOCKUPDATE" = "1" ]; then
@ -185,6 +190,9 @@ function create() {
# move the opsi wrapper to the right dir (close the error window if nothing needs to be done) # move the opsi wrapper to the right dir (close the error window if nothing needs to be done)
mv -v $INST_DIR/CLIENT_DATA/opsi-WinPKG.exe $INST_DIR/CLIENT_DATA/Install/ mv -v $INST_DIR/CLIENT_DATA/opsi-WinPKG.exe $INST_DIR/CLIENT_DATA/Install/
# change linefeed of bat files to work correctly
find $INST_DIR/CLIENT_DATA -name *.bat -print0 | xargs -0 unix2dos
# set exec bit on executeables # set exec bit on executeables
find $INST_DIR/CLIENT_DATA/Install/ -type f -print0 | xargs -0 chmod +x find $INST_DIR/CLIENT_DATA/Install/ -type f -print0 | xargs -0 chmod +x
find $INST_DIR/CLIENT_DATA/UnInstall/ -type f -print0 | xargs -0 chmod +x find $INST_DIR/CLIENT_DATA/UnInstall/ -type f -print0 | xargs -0 chmod +x