java_runtime template
java_runtime template
Good afternoon everyone:
I had been running into problems installing java on my Windows 8 machines using the existing opsi script I had. So I looked on the user scripts and have started using the one labeled java_runtime. (The other one there seems great but like a lot of overkill for me at this point).
The one I'm using is here:
wiki/userspace:java_runtime
It installs just fine but I was actually trying to get the delsub to work -- and in there, I'm getting an error in the for loop. During the opsi install it tells me that I shouldn't use a pre-defined variable. I've tried re-copying and re-pasting but that didn't seem to help anything. I tried changing it to use a %variable% like the examples in the manual use -- then setting a variable to the value in %variable% and that also didn't appear to work. This seems like it would be a really elegant way of handling uninstalls if I can get it working (for this and other products).
Anyone else have something like this working? Am I missing something obvious?
This is what is throwing the error:
Set $result$ = getRegistryKeyList64("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
for $app$ in $result$ do Sub_searchApp64
if not ($UninstallCommandList$ = "")
set $result1$ = splitString($UninstallCommandList$,"::")
for $UninstallCommand$ in $result1$ do Winbatch_uninstall_64 /64Bit
sub_check_exitcode
endif
Thanks all!
Brent
I had been running into problems installing java on my Windows 8 machines using the existing opsi script I had. So I looked on the user scripts and have started using the one labeled java_runtime. (The other one there seems great but like a lot of overkill for me at this point).
The one I'm using is here:
wiki/userspace:java_runtime
It installs just fine but I was actually trying to get the delsub to work -- and in there, I'm getting an error in the for loop. During the opsi install it tells me that I shouldn't use a pre-defined variable. I've tried re-copying and re-pasting but that didn't seem to help anything. I tried changing it to use a %variable% like the examples in the manual use -- then setting a variable to the value in %variable% and that also didn't appear to work. This seems like it would be a really elegant way of handling uninstalls if I can get it working (for this and other products).
Anyone else have something like this working? Am I missing something obvious?
This is what is throwing the error:
Set $result$ = getRegistryKeyList64("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
for $app$ in $result$ do Sub_searchApp64
if not ($UninstallCommandList$ = "")
set $result1$ = splitString($UninstallCommandList$,"::")
for $UninstallCommand$ in $result1$ do Winbatch_uninstall_64 /64Bit
sub_check_exitcode
endif
Thanks all!
Brent
Re: java_runtime template
try this:
or brutality:
Code: Alles auswählen
[DosInAnIcon]
wmic product where "name like 'Java(TM) 6%%'" call uninstall /nointeractive
wmic product where "name like 'Java 7%%'" call uninstall /nointeractive
Code: Alles auswählen
[DosInAnIcon]
wmic product where "name like 'Java%'" call uninstall /nointeractive
League of Legends invite: http://signup.leagueoflegends.com/?ref= ... 0857962219
Re: java_runtime template
I am using the same method for uninstall as hadro suggested, just keep in mind that on some computers it will never end (or after very long time) so I suggest adding "/WaitForProcessEnding":
Winbatch_uninstall_java7 /WaitForProcessEnding "wmic.exe" /TimeOutSeconds 600
[Winbatch_uninstall_java7]
wmic product where "name like 'Java 7%%'" call uninstall /nointeractive
You can look into your software inventory database for Java names needed..
Winbatch_uninstall_java7 /WaitForProcessEnding "wmic.exe" /TimeOutSeconds 600
[Winbatch_uninstall_java7]
wmic product where "name like 'Java 7%%'" call uninstall /nointeractive
You can look into your software inventory database for Java names needed..
Re: java_runtime template
Do you worry about a reboot after that's over (before installing?)?
BTW -- this is even more elegant. Thank you both for the response. I was struggling to keep my delsub updated with all the possible MSIDs and it was becoming incredibly complex/time consuming to debug.
Thanks!!
Brent
BTW -- this is even more elegant. Thank you both for the response. I was struggling to keep my delsub updated with all the possible MSIDs and it was becoming incredibly complex/time consuming to debug.
Thanks!!
Brent
Re: java_runtime template
Hi,
You can also use my tool "UninstMsi". It works similar to the "wmic" method, but a little smarter.
It provides evaluable Return Codes from msiexec and has a progress bar.
This example uninstalls all Java JRE versions 6 to 8
You can download UninstMsi (incl. opsi scripts) here:
wiki/userspace:uninstall_one_or_more_ve ... e_-product
You can also use my tool "UninstMsi". It works similar to the "wmic" method, but a little smarter.
It provides evaluable Return Codes from msiexec and has a progress bar.
This example uninstalls all Java JRE versions 6 to 8
Code: Alles auswählen
uninstmsi /product "Java%[6-8] Update%"
wiki/userspace:uninstall_one_or_more_ve ... e_-product
Re: java_runtime template
Thank you!
I am testing the uninstaller out now and it is working well for my Java installation as well as a quicktime opsi package I updated.
Thanks,
Brent
I am testing the uninstaller out now and it is working well for my Java installation as well as a quicktime opsi package I updated.
Thanks,
Brent
Re: java_runtime template
Hello,
Looks like great tool, but without source code I am not sure if it's safe to use..
Good luck
Looks like great tool, but without source code I am not sure if it's safe to use..
Good luck
mmarten hat geschrieben:Hi,
You can also use my tool "UninstMsi". It works similar to the "wmic" method, but a little smarter.
It provides evaluable Return Codes from msiexec and has a progress bar.
This example uninstalls all Java JRE versions 6 to 8You can download UninstMsi (incl. opsi scripts) here:Code: Alles auswählen
uninstmsi /product "Java%[6-8] Update%"
wiki/userspace:uninstall_one_or_more_ve ... e_-product
Re: java_runtime template
Hi,
for all those on the source code (AutoIt3) of "UnInstMsi" are interested, I have a download link provided.
http://goo.gl/HtshWu
Marcus
for all those on the source code (AutoIt3) of "UnInstMsi" are interested, I have a download link provided.
http://goo.gl/HtshWu
Marcus
mirkt hat geschrieben:Hello,
Looks like great tool, but without source code I am not sure if it's safe to use..
Good luck
mmarten hat geschrieben:Hi,
You can also use my tool "UninstMsi". It works similar to the "wmic" method, but a little smarter.
It provides evaluable Return Codes from msiexec and has a progress bar.
This example uninstalls all Java JRE versions 6 to 8You can download UninstMsi (incl. opsi scripts) here:Code: Alles auswählen
uninstmsi /product "Java%[6-8] Update%"
wiki/userspace:uninstall_one_or_more_ve ... e_-product
Re: java_runtime template
Thank you, Marcus!
- SisterOfMercy
- Beiträge: 1556
- Registriert: 22 Jun 2012, 19:18
Re: java_runtime template
That's why the code in the first post searches for all MSIs with the name "Java 7" in it.bbain hat geschrieben:I was struggling to keep my delsub updated with all the possible MSIDs and it was becoming incredibly complex/time consuming to debug.
Oh yeah, I should have edited the wiki a while ago.. This all costs time, which I don't have

Sometimes, not always, the Java installer wants a reboot, somehow. I have tried the wmic too, but if the java installer exits with exitcode 3010 it needs a reboot. If I'm correct this is the same any way you uninstall.
BTW, I never had errors in that for loop, so I can't help you much further. Please show your entire .ins files.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!