Jump to content

Recommended Posts

Posted

;uninstall java if exist
If RegRead( "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216023FF}", "UninstallString") = "" Then 
    RunWait( "msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F83216023FF}")
    
ElseIf ( "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216023FF}", "UninstallString") = "" Then 
        RunWait('msiexec.exe /i "' & @ScriptDir & '\' & $JavaMSI & '.msi" REBOOT=ReallySuppress TRANSFORMS=jre1.6.0_23.mst IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0 SYSTRAY=0 /passive /l*vx "C:\packages\logs\' & $JavaMSI & '.log"')

EndIf

I am trying to uninstall if exist if not than just install the application.. What am i doing wrong? Thanks in advance guys

Posted

;uninstall java if exist
If RegRead( "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216023FF}", "UninstallString") = "" Then 
    RunWait( "msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F83216023FF}")
    
ElseIf ( "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216023FF}", "UninstallString") = "" Then 
        RunWait('msiexec.exe /i "' & @ScriptDir & '\' & $JavaMSI & '.msi" REBOOT=ReallySuppress TRANSFORMS=jre1.6.0_23.mst IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0 SYSTRAY=0 /passive /l*vx "C:\packages\logs\' & $JavaMSI & '.log"')

EndIf

I am trying to uninstall if exist if not than just install the application.. What am i doing wrong? Thanks in advance guys

Hi teeboi,

in both cases you try to compare the same things. In the second you even forgot the "RegRead". Try changing the second operator from RegRead() = "" to Regread() <> "".

Regards,

Hannes

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Posted

Hannes thanks for your advise. I am really new @ this can you please tell me where do i need to insert the other variables?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...