Sign in to follow this  
Followers 0
teeboi

Need help with script

3 posts in this topic

;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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0