Sign in to follow this  
Followers 0
Chuck U

Novell Client Uninstall Script

16 posts in this topic

Hello.

I am having some issues with my code. Can someone help?

Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient")

If WinWaitActive("RUNDLL", "loading NWSETUP") Then

Send("{ENTER}")

Else

WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client")

Send("{ENTER}")

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")

Send("!y")

WinWaitActive("NMAS Client Components", "has been successfully uninstalled")

Send("{ENTER}")

WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer")

Send("!n")

EndIf

Everything seems to compile ok in SciTE but for whatever reason, everything past Else does not work.

When my script is the following.....

Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient")

WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client")

Send("{ENTER}")

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")

Send("!y")

WinWaitActive("NMAS Client Components", "has been successfully uninstalled")

Send("{ENTER}")

WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer")

Send("!n")

..... everything seems to work ok.

Help? :think:

Share this post


Link to post
Share on other sites



Surely in this line

If WinWaitActive("RUNDLL", "loading NWSETUP") Then

you should be checking for the return value from WinWaitActive.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Surely in this line

If WinWaitActive("RUNDLL", "loading NWSETUP") Then

you should be checking for the return value from WinWaitActive.

I am a newbie.... :think::( .... What do you mean?

Share this post


Link to post
Share on other sites

If WinWaitActive("RUNDLL", "loading NWSETUP") =1 Then

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I don't think that makes much sense... All that is going to do is wait until it becomes true anyway. Wouldn't you need to timeout or use If WinActive()?

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thanks for that info, but that did not seem to fix this issue....

I think it may have something to do with the Else.

This is the section of code that does not run....

Else
WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client")
Send("{ENTER}")
WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
Send("!y")
WinWaitActive("NMAS Client Components", "has been successfully uninstalled")
Send("{ENTER}")
WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer")
Send("!n")
EndIf

Share this post


Link to post
Share on other sites

Thanks for that info, but that did not seem to fix this issue....

I think it may have something to do with the Else.

This is the section of code that does not run....

Else
WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client")
Send("{ENTER}")
WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
Send("!y")
WinWaitActive("NMAS Client Components", "has been successfully uninstalled")
Send("{ENTER}")
WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer")
Send("!n")
EndIf
As I stated, there is no time out on any of your WinWaits... so the titles / text may be wrong, and it's not carrying through to the next part, because that window is never actually active, so it's still wating.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I don't think that makes much sense... All that is going to do is wait until it becomes true anyway. Wouldn't you need to timeout or use If WinActive()?

i didn't read the whole post... i just responded to BigDod and...

I am a newbie.... :think::( .... What do you mean?

8)

BTW... you are right


NEWHeader1.png

Share this post


Link to post
Share on other sites

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
Doesn't look right?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Uhh..

This

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")

Should be this

WinWaitActive("NMAS Client Components", "remove NMAS Client Components")

And, WinWaitActive pauses the script until the window is active, so you shouldnt have to check if its true do you?

Edited by jackyyll

Share this post


Link to post
Share on other sites

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
Doesn't look right?

SmOke is correct... however now that i have read your post ( as i should have at first)

once the window is active ("RUNDLL", "loading NWSETUP")

your program will use the send() command

and it DOES NOT enter the "Else" statement

example

$Value = 1

If $Value = 1 Then
    MsgBox('', '', "The value is 1 ")
Else
    MsgBox('', '', "The value is not 1 ")
EndIf

the else above is never entered... unless you chage the value.. like this

$Value = 0

If $Value = 1 Then
    MsgBox('', '', "The value is 1 ")
Else
    MsgBox('', '', "The value is not 1 ")
EndIf

hope that helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I have figured it out....

Here is the info....

Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient")

If WinWaitActive("RUNDLL", "loading NWSETUP", 3) = 1 Then 
    Send("{ENTER}")
    Exit
EndIf
    
If WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") = 1 Then
    Send("{ENTER}")
    WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
    Send("!y")
    WinWaitActive("NMAS Client Components", "has been successfully uninstalled")
    Send("{ENTER}")
    WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer")
    Send("!n") 
    EndIf

Thanks for the ideas.

-Chuck

Share this post


Link to post
Share on other sites

This:

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
Is still not correct, the 3rd parameter "&Yes", is how long to wait to time out, not what button to wait for.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

This:

WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")
Is still not correct, the 3rd parameter "&Yes", is how long to wait to time out, not what button to wait for.

i guess as a value it equals "0", but its still not correct

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

i guess as a value it equals "0", but its still not correct

8)

I don't know if it equals '0', I think I remember CyberSlug had said something previously about the strings actually retaining a numeric value... but I can't remember where that was, maybe it was the idea lab or bug reports.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

There are easier commandline ways to remove the Novell client, have a look at

http://support.novell.com/cgi-bin/search/s...i?/10070072.htm

http://www.novell.com/support/search.do?cm...0%200%201364777

ie RUNDLL32.EXE NWSETUP.DLL NWUninstallClient

However, this approach results in one additional prompt ("Are you sure you want to...") in addition to the NMAS concern described above.

Much easier to script that what you were upto before :think:

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