Jump to content

how to copy "infos" and some click questions


Recommended Posts

ok i am newbie and constantly i keep reading but i can't find what i need...ok i create the winamp script very simple script but when i finish that i need (for me) some advanced skills, i whont know what is the version of winamp..in the registry i can't find anything about version, only path to the winamp. then i in the script put the

if RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{77A366BA-2BE4-4a1e-9263-7734AA3E99A2}\LocalServer32", "") Then

MsgBox (0, "Winamp", "Delete old version", 3)

Exit

EndIf

ok, but this is very stupid i think, what if the some people have the new version of winamp...after that type that autoit open the "run" and type "winamp.exe" then winamp popup and with option "send" to winamp CTRL + F1, this oppeining about winamp...now the problem, i don't know how to select the version history (if someone have 1024x768 pixel resolution, and someone with 1920x1080 the mouse cords never be the same for clicks) after click i whont to copy the version, after copying version i whont that auto it know if the version 5.601 or numbers less than 5.601 uninstall winamp

if someone now just a little bit about this, just send me link for reading or just give me some clue...

thnx in advanced

Link to comment
Share on other sites

sleepydvdr

this is what i need, but know how i can use that, can i somehow copy that "text" what i got in the msgbox...i whont to use that version to uninstall or install new software :huh2:

BTW "fileopen" (can i open with that function notepad file, i trying almoust 30min and i don't know what's wrong)

Link to comment
Share on other sites

I don't know what you were doing, but the version number is the variable $wVersion. Here's what I did:

$loc = RegRead("HKEY_CURRENT_USER\Software\Winamp", "")
$wVersion = FileGetVersion ($loc & "\winamp.exe")

$wVersion2 = StringLeft($wVersion, 7) ; Take only the first 7 digits
$wVersion2 = StringReplace($wVersion2, ".", "") ; Get rid of the zeros

$wVersion2 = Number ($wVersion2) ; Converts the string to a number

If $wVersion2 <  5613 Then ; <-- Specify what version you want to compare to
    MsgBox(0, "", "Your version of Winamp is old. It is version: " & $wVersion)
Else
    MsgBox(0, "", "Your version of Winamp is up to date. It is version: " & $wVersion)
EndIf

It checks the version number, takes only the first part (assuming you don't care too much about the last bit, but the code can be modified if needed) and gets rid of the zeros. Then it converts to a number and compares the version number to whatever version you specify. Here, I went with the latest version. If it is older than 5.6.1.3 (like if you had version 5.6.1.2 or older) then you get an error message that it's old.

Edited by sleepydvdr

#include <ByteMe.au3>

Link to comment
Share on other sites

I don't know what you were doing, but the version number is the variable $wVersion. Here's what I did:

$loc = RegRead("HKEY_CURRENT_USER\Software\Winamp", "")
$wVersion = FileGetVersion ($loc & "\winamp.exe")

$wVersion2 = StringLeft($wVersion, 7) ; Take only the first 7 digits
$wVersion2 = StringReplace($wVersion2, ".", "") ; Get rid of the zeros

$wVersion2 = Number ($wVersion2) ; Converts the string to a number

If $wVersion2 <  5613 Then ; <-- Specify what version you want to compare to
    MsgBox(0, "", "Your version of Winamp is old. It is version: " & $wVersion)
Else
    MsgBox(0, "", "Your version of Winamp is up to date. It is version: " & $wVersion)
EndIf

It checks the version number, takes only the first part (assuming you don't care too much about the last bit, but the code can be modified if needed) and gets rid of the zeros. Then it converts to a number and compares the version number to whatever version you specify. Here, I went with the latest version. If it is older than 5.6.1.3 (like if you had version 5.6.1.2 or older) then you get an error message that it's old.

thnx man this is very helpful, for now i have one more question, can i use $vWersion2 (data) and copy in the notepad

Send ("#r C:\Users\WPI\Desktop\proba.txt {ENTER}")
WinWaitActive ("proba - Notepad", "")
Send ("^{END}{ENTER}")

and at the end of that notepad file, to type the version :huh2:

Link to comment
Share on other sites

Below is the closest thing to what you wrote:

ShellExecute("proba.txt")
WinWaitActive ("proba - Notepad", "")
Send("^{END}" & @CRLF & $wVersion)

But you could accomplish the same thing with this line (no need to open it in Notepad):

FileWrite("proba.txt", @CRLF & $wVersion)

However, depending on what you are trying to accomplish, there might be a better way. In your first post, you said you wanted to use the version number to decide whether to uninstall WinAmp and install a newer version. You do not need to write anything to notepad to do this. In my other code, all you would have to do is perform those operations in the If/Then/EndIF section instead of the message boxes. Or if you are trying to track versions, I would suggest using an ini file. Read in the help file the command IniWrite.

Edited by sleepydvdr

#include <ByteMe.au3>

Link to comment
Share on other sites

Then try this:

$loc = RegRead("HKEY_CURRENT_USER\Software\Winamp", "")
$wVersion = FileGetVersion ($loc & "\winamp.exe")

$wVersion2 = StringLeft($wVersion, 7)
$wVersion2 = StringReplace($wVersion2, ".", "")

$wVersion2 = Number ($wVersion2)

If $wVersion2 <  5613 Then
    $ans = MsgBox(4, "", "Your version of Winamp is old. It is version: " & $wVersion & ". Would you like to upgrade?")
    If $ans = 6 Then 
    RunWait($loc & "\UninstWA.exe") 
    Run(@ScriptDir & "\winamp561_full_emusic-7plus_en-us.exe")
    EndIf       
Else
    MsgBox(0, "", "Your version of Winamp is up to date. It is version: " & $wVersion)
EndIf
Edited by sleepydvdr

#include <ByteMe.au3>

Link to comment
Share on other sites

How can i add some timer cca 5-10 second if "$ans = 6 Then" if some does't click anything to automaticly click yes

EDIT: i set on the msgbox timeout 5 second, but if nobody respond, how can send YES to the msgbox

Edited by borism25
Link to comment
Share on other sites

$loc = RegRead("HKEY_CURRENT_USER\Software\Winamp", "")
$wVersion = FileGetVersion ($loc & "\winamp.exe")

$wVersion2 = StringLeft($wVersion, 7)
$wVersion2 = StringReplace($wVersion2, ".", "")

$wVersion2 = Number ($wVersion2)

If $wVersion2 <  5613 Then
    $ans = MsgBox(4, "", "Your version of Winamp is old. It is version: " & $wVersion & ". Would you like to upgrade?", 10) ; 10 is the number of seconds to wait
    If $ans = 7 Then ; If the user clicks No, it will exit. Any thing else will install the software, including the message box timing out.
        Exit
    Else
    RunWait($loc & "\UninstWA.exe") 
    Run(@ScriptDir & "\winamp561_full_emusic-7plus_en-us.exe")
    EndIf       
Else
    MsgBox(0, "", "Your version of Winamp is up to date. It is version: " & $wVersion)
EndIf

#include <ByteMe.au3>

Link to comment
Share on other sites

If $wVersion2 < 5613 Then

$ans = MsgBox(4, "", "Your version of Winamp is old. It is version: " & $wVersion & ". Would you like to upgrade?", 10) ; 10 is the number of seconds to wait

If $ans = 7 Then ; If the user clicks No, it will exit. Any thing else will install the software, including the message box timing out.

Exit

i need something like this

If $wVersion2 > 1 < 5613 Then

from number 1 to 5613, becouse 0 is when winamp is't install on computer

Link to comment
Share on other sites

ok i will post here, complete code, maybe to someone this will be helpfull (at the end of the file i create the sfx file that expand winamp configuration file in the %appdata%\Winamp)

big thnx sleepydvdr for help me with this :huh2:

FileInstall ( "C:\Users\WPI\Desktop\Winamp\Winamp.exe", @ScriptDir & "\Winamp.exe")


$loc = RegRead("HKEY_CURRENT_USER\Software\Winamp", "") ;Local Path
$wVersion = FileGetVersion ($loc & "\winamp.exe") ;Get Version of Winamp

$wVersion2 = StringLeft ($wVersion, 7) ;Left 7 Numbers
$wVersion2 = StringReplace ($wVersion2, ".", "") 
$wVersion2 = Number ($wVersion2) ;Number


If $wVersion2 > 1 AND $wVersion2 < 5609 Then ;If 5609 or Lower
        RunWait($loc & "\UninstWA.exe") 
        WinWaitActive ("Winamp Uninstall", "&Uninstall") ;Uninstall Winamp
        Sleep (1000)
        ControlClick ("Winamp Uninstall", "&Uninstall", "[ID: 1]")
        
        WinWaitActive ("Winamp Uninstall", "&Finish") ;Finish
        Sleep (1000)
        ControlClick ("Winamp Uninstall", "&Finish", "[ID: 1]")
        Sleep(1000)
    ElseIf $wVersion2 >= 5610 AND $wVersion2 < 5615 Then
        MsgBox (0, "Winamp", "Winamp Is Up To Date", 5)
        Exit
    ElseIf $wVersion2 = 0 Then
        msgbox (0, "Winamp", "Winamp Is Not Installed", 5)
    EndIf

    
Run (@ScriptDir & "\Winamp 5.6.exe")

;Installer Language - English
WinWaitActive ("Installer Language", "OK")
Sleep (1500)
ControlClick ("Installer Language", "OK", "[ID: 1]")
Sleep (1000)

;Welcome to winamp installer
WinWaitActive ("Winamp Installer", "&Next >")
Sleep (1000)
ControlClick ("Winamp Installer", "&Next >", "[ID: 1]")

;License Agreement
WinWaitActive ("Winamp Installer", "I &Agree")
Sleep (500)
ControlClick ("Winamp Installer", "I &Agree", "[ID: 1]")
Sleep (1000)

;Choose Install Location
WinWaitActive ("Winamp Installer", "&Next >")
Sleep (500)
ControlClick ("Winamp Installer", "&Next >", "[ID: 1]")
Sleep (1000)

;Choose Components
WinWaitActive ("Winamp Installer", "&Next >")
Sleep (1000)
Send ("{TAB}{DOWN}{SPACE}")
Sleep (500)
Send ("{DOWN}{RIGHT}{DOWN 2}{SPACE}{LEFT 2}")
Sleep (500)
Send ("{DOWN 4}{RIGHT}{DOWN}{SPACE}{LEFT 2}")
Sleep (500)
Send ("{DOWN}{SPACE}")
ControlClick ("Winamp Installer", "&Next >", "[ID: 1]")
Sleep (1000)

;Choose Start Options
WinWaitActive ("Winamp Installer", "&Next >")
Sleep (1000)
;Create Start menu entry
ControlClick ("Winamp Installer", "Create Start menu entry", "[ID: 1202]")
Sleep (100)
;Create Quick Launch icon
ControlClick ("Winamp Installer", "Create Quick Launch icon", "[ID: 1203]")
Sleep (100)
;Create Desktop icon
ControlClick ("Winamp Installer", "Create Desktop icon", "[ID: 1204]")
Sleep (100)
ControlClick ("Winamp Installer", "&Next >", "[ID: 1]")
Sleep (1000)

;Get the Most Out of Winamp
WinWaitActive ("Winamp Installer", "&Next >")
Sleep (1000)
;Winamp® Toolbar
ControlClick ("Winamp Installer", "Winamp® Toolbar", "[ID: 1201]")
Sleep (100)
;Set AOL® Search as my default search engine
ControlClick ("Winamp Installer", "Set AOL® Search as my default search engine", "[ID: 1205]")
Sleep (100)
;50 free MP3 Downloads +1 free Audiobook from eMusic
ControlClick ("Winamp Installer", "50 free MP3 Downloads +1 free Audiobook from eMusic", "[ID: 1207]")
Sleep (100)
ControlClick ("Winamp Installer", "&Next >", "[ID: 1]")
Sleep (1000)

;Finish
WinWaitActive ("Winamp Installer", "Finish")
Sleep (500)
ControlClick ("Winamp Installer", "Finish", "[ID: 1]")
Sleep (1000)

;Choose Skin
WinWaitActive ("Winamp Setup", "&Next")
Sleep (500)
ControlClick ("Winamp Setup", "&Next", "[ID: 1001]")
Sleep (1000)

;File Associations
WinWaitActive ("Winamp Setup", "&Next")
Sleep (500)
Send ("{DOWN 2}{SPACE}")
Sleep (100)
ControlClick ("Winamp Setup", "&Next", "[ID: 1001]")
Sleep (1000)

;Choose Online Services
WinWaitActive ("Winamp Setup", "&Next")
Sleep (500)
Send ("{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}")
Sleep (100)
ControlClick ("Winamp Setup", "Fini&sh", "[ID: 1]")
Sleep (1000)

;Add Media to Library
WinWaitActive ("Add Media to Library", "Close")
Sleep (500)
ControlClick ("Add Media to Library", "Do not show me this again", "[ID: 1052]")
Sleep (500)
ControlClick ("Add Media to Library", "Close", "[ID: 1]")
Sleep (1000)

Send ("!{F4}")
sleep (1000)

Run ("C:\Users\WPI\Desktop\Winamp\Configuration.exe")

WinWaitActive ("WinRAR self-extracting archive", "Install")
sleep (1000)
Controlclick ("WinRAR self-extracting archive", "Install", "[ID:1]")

Exit
Edited by borism25
Link to comment
Share on other sites

OK, when everything work 100% i downloaded the latest winamp and compile but i get little problem, i don't know how to access with keystrokes or mouseclicks to "DON'T INSTALL NITRO PDF or SPEECH GRID"

http://www.pohrani.com/f/b/xn/1MtHzXAk/screenshot00142.jpg

this is picture what i get...i can't get ID of that buttons, trying with every possible keystroke to jump up from install to do not install nitro PDF (sometimes i get the speech grid instead nitro pdf)

>>>> Window <<<<

Title: Winamp Installer

Class: #32770

Position: 502, 248

Size: 503, 389

Style: 0x94CA084C

ExStyle: 0x00010100

Handle: 0x00160196

>>>> Control <<<<

Class: #32770

Instance: 1

ClassnameNN: #327701

Name:

Advanced (Class): [CLASS:#32770; INSTANCE:1]

ID:

Text:

Position: 14, 70

Size: 470, 228

ControlClick Coords: 195, 65

Style: 0x5000044C

ExStyle: 0x00010000

Handle: 0x0005024A

>>>> Mouse <<<<

Position: 714, 408

Cursor ID: 0

Color: 0x000000

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

< &Back

&Install

Cancel

Nullsoft Winamp 5.601 -- built on 12/9/2010 at 5:50:48 AM

Nullsoft Winamp 5.601 -- built on 12/9/2010 at 5:50:48 AM

Install Nitro PDF Reader

Recommended by Winamp

>>>> Hidden Text <<<<

EDIT: ok i figure something if i disable network then nitro pdf and speech grid never show up...now i whont to know how to disable netwoork :huh2:

EDIT2: netsh interface set interface name="Local Area Connection" admin=DISABLED this runing in cmd disabling the network, work like a charm ;)

Edited by borism25
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...