Jump to content

Need help with script


teeboi
 Share

Recommended Posts

;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

Link to comment
Share on other sites

;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]
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...