Combine cuztomized Java with Bigfix script

(imported topic written by DC2308)

Hi All,

I would like to combine my customized Java 6.29 with the script Bigfix created that will close any running instance of IE, Firefox or Java but I’m not sure how to setup the script. Below I have my customized Java script and the one from the Bigfix. Basically, I would like to use the Bigfix script replacing with my customized Java MSI/MST so it closes any running instance of Java. Any ideas on how to set this up?

Thxs!

My Custom Java 6.29:

//**Begin Preparation Marker

// Download all specified files

begin prefetch block

add prefetch item name=B009005F82E5D89376E69A6FE766CA3F059A1F26 sha1=b009005f82e5d89376e69a6fe766ca3f059a1f26 size=13101952 url=SWDProtocol://127.0.0.1:52311/uploads/B009005F82E5D89376E69A6FE766CA3F059A1F26/Data1.cab.bfswd

add prefetch item name=C0A58FC61D9DAC0C113D56A9EAB9000BE108618F sha1=c0a58fc61d9dac0c113d56a9eab9000be108618f size=79488 url=SWDProtocol://127.0.0.1:52311/uploads/C0A58FC61D9DAC0C113D56A9EAB9000BE108618F/gtapi.dll.bfswd

add prefetch item name=7A3BBAAB20DE2FC996BCC1016E2379FE2B8B662F sha1=7a3bbaab20de2fc996bcc1016e2379fe2b8b662f size=15663616 url=SWDProtocol://127.0.0.1:52311/uploads/7A3BBAAB20DE2FC996BCC1016E2379FE2B8B662F/javacustom6v29.MST.bfswd

add prefetch item name=D4C4497137F9FB4A130AE940FFAD7FE1915A08AE sha1=d4c4497137f9fb4a130ae940ffad7fe1915a08ae size=907264 url=SWDProtocol://127.0.0.1:52311/uploads/D4C4497137F9FB4A130AE940FFAD7FE1915A08AE/jre1.6.0_29.msi.bfswd

add prefetch item name=6A8CF20F019266FFC125B93D2727A551877DE4A2 sha1=6a8cf20f019266ffc125b93d2727a551877de4a2 size=152576 url=SWDProtocol://127.0.0.1:52311/uploads/6A8CF20F019266FFC125B93D2727A551877DE4A2/lzma.dll.bfswd

end prefetch block

// All SWD Files will go into a folder in the clients __BESData folder. This folder get cleared on every restart.

parameter “baseFolder” = “__Download/”

// Move files into subfolders and unescape file names

move “__Download/B009005F82E5D89376E69A6FE766CA3F059A1F26” “{parameter “baseFolder”}Data1.cab”

move “__Download/C0A58FC61D9DAC0C113D56A9EAB9000BE108618F” “{parameter “baseFolder”}gtapi.dll”

move “__Download/7A3BBAAB20DE2FC996BCC1016E2379FE2B8B662F” “{parameter “baseFolder”}javacustom6v29.MST”

move “__Download/D4C4497137F9FB4A130AE940FFAD7FE1915A08AE” “{parameter “baseFolder”}jre1.6.0_29.msi”

move “__Download/6A8CF20F019266FFC125B93D2727A551877DE4A2” “{parameter “baseFolder”}lzma.dll”

//**End Preparation Marker

// Run setup process

delete __createfile

delete run.bat

// Use .bat to set working directory to packages root, for setup command.

createfile until

end

@ECHO OFF

cd “{parameter “baseFolder”}”

rem // See comments at the beginning of this action for an explanation of the comment markers.

rem //**Begin Command Marker

msiexec.exe /i “jre1.6.0_29.msi” /qn TRANSFORMS=“javacustom6v29.MST”

rem //**End Command Marker

end

move __createfile run.bat

// You will not be able to stop or take action on an applicable BES Client until your installer completes.

// So ensure no user input is required.

// If your package absolutely must interact with the user, replace ‘waithidden’ with ‘run’.

waithidden run.bat

BigFix Java 6.29 Script (will close any running instance of IE, Firefox or Java):

prefetch jre-6u29-windows-i586.exe sha1:a0f484c0521106b6fb5e75af3d6e4a6233a04f3a size:16897824 http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jre-6u29-windows-i586.exe

// Note: update .exe will restart service automatically

if{exists running service “JavaQuickStarterService”}

delete __appendfile

delete stop_javaquickstarter.bat

appendfile net stop JavaQuickStarterService

move __appendfile stop_javaquickstarter.bat

waithidden stop_javaquickstarter.bat

endif

waithidden taskkill /F /IM java.exe

waithidden taskkill /F /IM javaw.exe

waithidden taskkill /F /IM javaws.exe

waithidden taskkill /F /IM iexplore.exe

waithidden taskkill /F /IM firefox.exe

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation

" “InstallingJava32”=dword:00000001

waithidden __Download/jre-6u29-windows-i586.exe /s /norestart

action may require restart “a0f484c0521106b6fb5e75af3d6e4a6233a04f3a”

continue if {((exists value “DisplayVersion” whose ((it >= “6.0.290”) of ((if (it as string = “1.5.0”) then (it as string & “.00”) else (it as string)) as version)) of keys whose ((value “DisplayName” of it as string as lowercase contains “j2se runtime environment” OR value “DisplayName” of it as string as lowercase starts with “java™”)) of it) AND (exists key whose (((it contains “java” OR it contains “j2se”) AND (it contains “runtime environment” OR it contains “update”)) of (value “DisplayName” of it as string as lowercase)) of it)) of key “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

regdelete "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation

" “InstallingJava32”

(imported comment written by SystemAdmin)

Hey,

In the BigFix JRE installation fixlet the following lines close any instance of java, IE or firefox -

waithidden taskkill /F /IM java.exe

waithidden taskkill /F /IM javaw.exe

waithidden taskkill /F /IM javaws.exe

waithidden taskkill /F /IM iexplore.exe

waithidden taskkill /F /IM firefox.exe

You can simply use these commands in your customized script before running your JRE installation using the msi (before waithidden run.bat).

(imported comment written by DC2308)

Awesome! Looks like that is working, my script below. (Sorry, I am a newb with scripts)

On another issue, when I push out my custom script through Bigfix on my test machines it will install the proper version of Java but will not take my custom mst with Java updates disabled. But if I remove Java completely from the test machine and re-push through Bigfix my Java will install properly with updates disabled. Any ideas why it does this?

Line:

//**Begin Preparation Marker

// Download all specified files

begin prefetch block

add prefetch item name=B009005F82E5D89376E69A6FE766CA3F059A1F26 sha1=b009005f82e5d89376e69a6fe766ca3f059a1f26 size=13101952 url=SWDProtocol://127.0.0.1:52311/uploads/B009005F82E5D89376E69A6FE766CA3F059A1F26/Data1.cab.bfswd

add prefetch item name=C0A58FC61D9DAC0C113D56A9EAB9000BE108618F sha1=c0a58fc61d9dac0c113d56a9eab9000be108618f size=79488 url=SWDProtocol://127.0.0.1:52311/uploads/C0A58FC61D9DAC0C113D56A9EAB9000BE108618F/gtapi.dll.bfswd

add prefetch item name=7A3BBAAB20DE2FC996BCC1016E2379FE2B8B662F sha1=7a3bbaab20de2fc996bcc1016e2379fe2b8b662f size=15663616 url=SWDProtocol://127.0.0.1:52311/uploads/7A3BBAAB20DE2FC996BCC1016E2379FE2B8B662F/javacustom6v29.MST.bfswd

add prefetch item name=D4C4497137F9FB4A130AE940FFAD7FE1915A08AE sha1=d4c4497137f9fb4a130ae940ffad7fe1915a08ae size=907264 url=SWDProtocol://127.0.0.1:52311/uploads/D4C4497137F9FB4A130AE940FFAD7FE1915A08AE/jre1.6.0_29.msi.bfswd

add prefetch item name=6A8CF20F019266FFC125B93D2727A551877DE4A2 sha1=6a8cf20f019266ffc125b93d2727a551877de4a2 size=152576 url=SWDProtocol://127.0.0.1:52311/uploads/6A8CF20F019266FFC125B93D2727A551877DE4A2/lzma.dll.bfswd

end prefetch block

// All SWD Files will go into a folder in the clients __BESData folder. This folder get cleared on every restart.

parameter “baseFolder” = “__Download/”

// Move files into subfolders and unescape file names

move “__Download/B009005F82E5D89376E69A6FE766CA3F059A1F26” “{parameter “baseFolder”}Data1.cab”

move “__Download/C0A58FC61D9DAC0C113D56A9EAB9000BE108618F” “{parameter “baseFolder”}gtapi.dll”

move “__Download/7A3BBAAB20DE2FC996BCC1016E2379FE2B8B662F” “{parameter “baseFolder”}javacustom6v29.MST”

move “__Download/D4C4497137F9FB4A130AE940FFAD7FE1915A08AE” “{parameter “baseFolder”}jre1.6.0_29.msi”

move “__Download/6A8CF20F019266FFC125B93D2727A551877DE4A2” “{parameter “baseFolder”}lzma.dll”

//**End Preparation Marker

// Run setup process

delete __createfile

delete run.bat

// Note: update .exe will restart service automatically

if{exists running service “JavaQuickStarterService”}

delete __appendfile

delete stop_javaquickstarter.bat

appendfile net stop JavaQuickStarterService

move __appendfile stop_javaquickstarter.bat

waithidden stop_javaquickstarter.bat

endif

waithidden taskkill /F /IM java.exe

waithidden taskkill /F /IM javaw.exe

waithidden taskkill /F /IM javaws.exe

waithidden taskkill /F /IM iexplore.exe

waithidden taskkill /F /IM firefox.exe

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation

" “InstallingJava32”=dword:00000001

// Use .bat to set working directory to packages root, for setup command.

createfile until

end

@ECHO OFF

cd “{parameter “baseFolder”}”

rem // See comments at the beginning of this action for an explanation of the comment markers.

rem //**Begin Command Marker

msiexec.exe /i “jre1.6.0_29.msi” /qn TRANSFORMS=“javacustom6v29.MST”

action may require restart “a0f484c0521106b6fb5e75af3d6e4a6233a04f3a”

continue if {((exists value “DisplayVersion” whose ((it >= “6.0.290”) of ((if (it as string = “1.5.0”) then (it as string & “.00”) else (it as string)) as version)) of keys whose ((value “DisplayName” of it as string as lowercase contains “j2se runtime environment” OR value “DisplayName” of it as string as lowercase starts with “java™”)) of it) AND (exists key whose (((it contains “java” OR it contains “j2se”) AND (it contains “runtime environment” OR it contains “update”)) of (value “DisplayName” of it as string as lowercase)) of it)) of key “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

regdelete "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation

" “InstallingJava32”

rem //**End Command Marker

end

move __createfile run.bat

// You will not be able to stop or take action on an applicable BES Client until your installer completes.

// So ensure no user input is required.

// If your package absolutely must interact with the user, replace ‘waithidden’ with ‘run’.

waithidden run.bat