Jump to content

Winamp @ Autoit


smeko

Recommended Posts

Hello. I will make a Nlite addon with Autoit with Winamp. When I run the script normally everything works all right.

I have configured that there should not be any desktop icons and startmeny group. When in making a cab/7z file im using the switch /S. After t-13 theres is a desktop icon and a programgroup and winamp Toolbar and all the other stuffs that i have removed

I hope someone can help me :huh:

Install.au3

Edited by smeko
Link to comment
Share on other sites


Hi,

Perhaps it is how you are missing some window waits before using Send() that maybe causing the issue. I have cleaned up your code some and made some minor changes. Hopefully it may solve your problem. You could use FileDelete to remove any shortcuts and DirRemove to remove the group folder from the startmenu. I would also delete the toolbar installer if possible (something for you to consider).


#RequireAdmin

Opt ('SendKeyDelay', 1500); pauses between sent keystrokes
Opt ('TrayIconDebug', True)

$pid = Run ("winamp.exe")
If @error Then Exit 1

;Language
_WinWaitActive ("Installer Language" , "")
Send ("{ENTER}")

;Välkommen till installationsprogrammet för Winamp
_WinWaitActive ("Installationsprogram för Winamp" , "")
ControlClick ("Installationsprogram för Winamp" , "" , "Button2")

;Licens
_WinWaitActive ("Installationsprogram för Winamp" , "")
ControlClick ("Installationsprogram för Winamp" , "" , "Button2")

;Installationsprogram för Winamp
_WinWaitActive ("Installationsprogram för Winamp" , "")
ControlClick ("Installationsprogram för Winamp" , "" , "Button2")

;Välj komponenter
_WinWaitActive ( "Installationsprogram för Winamp" , "" )
Send ("{TAB}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}")
ControlClick ( "Installationsprogram för Winamp" , "" , "Button2")

;Välj startalternativ
_WinWaitActive ( "Installationsprogram för Winamp" , "" ); added (correct title?)
Send ("{TAB 3}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}")
ControlClick ( "Installationsprogram för Winamp" , "" , "Button2")

;Utnyttja hela potentialen hos Winamp
_WinWaitActive ( "Installationsprogram för Winamp" , "" ); added (correct title?)
Send ("{TAB 2}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}")
ControlClick ( "Installationsprogram för Winamp" , "" , "Button2")

;Installationen är klar
Sleep(4000)
_WinWaitActive ("Installationsprogram för Winamp" , "")
Send ("{ENTER}")

;Välj Skal
_WinWaitActive ("Installera Winamp" , "")
ControlClick ("Installera Winamp" , "" , "Button5")

;Inställningar
_WinWaitActive ( "Installera Winamp" , "" )
Send ("{DOWN 2}{RIGHT}{DOWN}{SPACE}{DOWN}{SPACE}")
ControlClick ( "Installera Winamp" , "" , "Button5")

;Sista inställnigar
_WinWaitActive ( "Installera Winamp" , "" )
Send ("{TAB 3}{SPACE}")
ControlClick ( "Installera Winamp" , "" , "Button6")

ProcessWaitClose($pid, 300)

;Waits for winamp to start, then silently kills it
If ProcessWait('winamp.exe', 120) Then
For $i = 1 To 2
ProcessClose('winamp.exe')
If Not ProcessExists('winamp.exe') Then
ExitLoop
EndIf
Sleep(1000)
Next
EndIf

Exit

Func OnAutoItStart()
; single script instance only
If WinExists(@ScriptName & '_Interpreter') Then Exit
AutoItWinSetTitle(@ScriptName & '_Interpreter')
EndFunc

Func _WinWaitActive($title, $text = '')
; window wait functions
WinWait($title, $text)
WinActivate($title, $text)
WinWaitActive($title, $text)
EndFunc

Link to comment
Share on other sites

And another one :)

; Intaller file name
$Installer = "winamp5552_pro_all.exe"
; Create Start Menu folder
$StartMenuFolder = 0
; Keep the Desktop icon
$DesktopIcon = 0
; Keep the Quick Launch icon
$QuickLaunchIcon = 0

; Installation folder
$InstallDir = @ProgramFilesDir & "\Winamp"
$PreviousInstallation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winamp", "UninstallString")
If StringRight($PreviousInstallation, 1) = '"' Then
$PreviousInstallation = StringTrimRight($PreviousInstallation, 1)
EndIf
If StringLeft($PreviousInstallation, 1) = '"' Then
$PreviousInstallation = StringTrimLeft($PreviousInstallation, 1)
EndIf
If FileExists($PreviousInstallation) Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of Winamp before using this script", 4)
Exit
EndIf

; Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
AdlibEnable('_Adlib')

; Run the installer
RunWait($Installer & " /S /D=" & $InstallDir)

; Uninstall 50 FREE MP3s +1 Free Audiobook! (bundle3.exe installer work too fast to be stopped)
RunWait($InstallDir & "\eMusic\Uninst-eMusic-promotion.exe" & " /S")

; Create Start Menu folder
If $StartMenuFolder = 1 Then
DirCreate(@ProgramsCommonDir & "\Winamp")
FileCreateShortcut($InstallDir & "\UninstWA.exe", @ProgramsCommonDir & "\Winamp\Uninstall Winamp.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\whatsnew.txt", @ProgramsCommonDir & "\Winamp\What's New.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\winamp.exe", @ProgramsCommonDir & "\Winamp\Winamp.lnk", $InstallDir & "\Lang")
EndIf

; Delete the Desktop icon
If $DesktopIcon = 0 Then
FileDelete(@DesktopCommonDir & "\Winamp.lnk")
EndIf

; Delete the Quick Launch icon
If $QuickLaunchIcon = 0 Then
FileDelete(@AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\Winamp.lnk")
EndIf

Sleep(3000)

; Close Au_.exe process
$PID = ProcessExists("Au_.exe")
If $PID Then
ProcessClose($PID)
EndIf

; Stop checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
AdlibDisable()

; Clean the Temp folder
#include
;#include
$avDirList1 = _FileListToArray(@TempDir, "n*.tmp", 2)
;_ArrayDisplay($avDirList2)
If IsArray($avDirList1) Then
For $n = 1 To $avDirList1[0]
$sPath = @TempDir & "\" & $avDirList1[$n]
If FileExists($sPath & "\") Then
DirRemove($sPath, 1)
EndIf
Next
EndIf
$avDirList1 = _FileListToArray(@TempDir, "~nsu.tmp", 2)
;_ArrayDisplay($avDirList2)
If IsArray($avDirList1) Then
For $n = 1 To $avDirList1[0]
$sPath = @TempDir & "\" & $avDirList1[$n]
If FileExists($sPath & "\") Then
DirRemove($sPath, 1)
EndIf
Next
EndIf

Func _Adlib()
; Kill Winamp Remote installation process
ProcessClose("bundle1.exe")
; Kill Mozilla Firefox toolbar installation process
ProcessClose("bundle2.exe")
; Kill Internet Explorer 7 or 8 toolbar installation process
ProcessClose("winamp_toolbar_ie.exe")
EndFunc

Silent installation, all icons, Winamp Remote and toolbars will be removed.

Edited by radix
Link to comment
Share on other sites

Hello Radix and MHZ again

Im trying to use this at T-13 silently, first im trying in windows and its doesnt work. The codes u gives give apears do same thing Winamp Remote. FreeMusic,Desktopicon and groupmenu icon. Here is MHZ Code:

Winamp.exe /S in Autoit code

mhz.png

Here is Radix Code: Using Winamp.exe /S

radix.png

And here is my original file:

This is when i run without /S

This is how i want it its Perfect but when im using /S it ruins everything

minl.png

Link to comment
Share on other sites

Try again with this:

; Intaller file name
$Installer = "winamp5552_pro_all.exe"
; Create Start Menu folder
$StartMenuFolder = 0
; Keep the Desktop icon
$DesktopIcon = 0
; Keep the Quick Launch icon
$QuickLaunchIcon = 0

; Installation folder
$InstallDir = @ProgramFilesDir & "\Winamp"
$PreviousInstallation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winamp", "UninstallString")
If StringRight($PreviousInstallation, 1) = '"' Then
$PreviousInstallation = StringTrimRight($PreviousInstallation, 1)
EndIf
If StringLeft($PreviousInstallation, 1) = '"' Then
$PreviousInstallation = StringTrimLeft($PreviousInstallation, 1)
EndIf
If FileExists($PreviousInstallation) Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of Winamp before using this script", 4)
Exit
EndIf

; Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
AdlibEnable('_Adlib')

; Run the installer
RunWait($Installer & " /S /D=" & $InstallDir)

; Uninstall 50 FREE MP3s +1 Free Audiobook! (bundle3.exe installer work too fast to be stopped)
RunWait($InstallDir & "\eMusic\Uninst-eMusic-promotion.exe" & " /S")

; Create Start Menu folder
If $StartMenuFolder = 1 Then
DirCreate(@ProgramsCommonDir & "\Winamp")
FileCreateShortcut($InstallDir & "\UninstWA.exe", @ProgramsCommonDir & "\Winamp\Uninstall Winamp.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\whatsnew.txt", @ProgramsCommonDir & "\Winamp\What's New.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\winamp.exe", @ProgramsCommonDir & "\Winamp\Winamp.lnk", $InstallDir & "\Lang")
EndIf

; Delete the Desktop icon
If $DesktopIcon = 0 Then
FileDelete(@DesktopCommonDir & "\Winamp.lnk")
EndIf

; Delete the Quick Launch icon
If $QuickLaunchIcon = 0 Then
FileDelete(@AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\Winamp.lnk")
EndIf

; Stop checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
AdlibDisable()

Func _Adlib()
; Kill Winamp Remote installation process
ProcessClose("bundle1.exe")
; Kill Mozilla Firefox toolbar installation process
ProcessClose("bundle2.exe")
; Kill Internet Explorer 7 or 8 toolbar installation process
ProcessClose("winamp_toolbar_ie.exe")
EndFunc

Edited by radix
Link to comment
Share on other sites

Try again with this:


#RequireAdmin

; Installer file name
$Installer = "winamp5552_pro_all.exe"
; Create Start Menu folder
$StartMenuFolder = 0
; Keep the Desktop icon
$DesktopIcon = 0
; Keep the Quick Launch icon
$QuickLaunchIcon = 0

; Installation folder
$InstallDir = @ProgramFilesDir & "\Winamp"
$PreviousInstallation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winamp", "UninstallString")
_QuoteRemove($PreviousInstallation)
If FileExists($PreviousInstallation) Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of Winamp before using this script", 4)
Exit
EndIf

; create file to block eMusic install folder creation
FileWrite($InstallDir & '\eMusic', 'dummy file')

; Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
AdlibEnable('_Adlib')

; Run the installer
RunWait($Installer & " /S /D=" & $InstallDir)

; Uninstall 50 FREE MP3s +1 Free Audiobook! (bundle3.exe installer work too fast to be stopped)
If FileExists($InstallDir & "\eMusic\Uninst-eMusic-promotion.exe") Then
RunWait($InstallDir & "\eMusic\Uninst-eMusic-promotion.exe" & " /S")
EndIf

; Create Start Menu folder
If $StartMenuFolder = 1 Then
DirCreate(@ProgramsCommonDir & "\Winamp")
FileCreateShortcut($InstallDir & "\UninstWA.exe", @ProgramsCommonDir & "\Winamp\Uninstall Winamp.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\whatsnew.txt", @ProgramsCommonDir & "\Winamp\What's New.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\winamp.exe", @ProgramsCommonDir & "\Winamp\Winamp.lnk", $InstallDir & "\Lang")
EndIf

; Delete all associated Desktop icons
If $DesktopIcon = 0 Then
FileDelete(@DesktopDir & "\Winamp.lnk")
FileDelete(@DesktopDir & "\Winamp Remote.lnk")
FileDelete(@DesktopDir & "\50 Free MP3s*.lnk")
FileDelete(@DesktopCommonDir & "\Winamp.lnk")
FileDelete(@DesktopCommonDir & "\Winamp Remote.lnk")
FileDelete(@DesktopCommonDir & "\50 Free MP3s*.lnk")
EndIf

; Delete the Quick Launch icon
If $QuickLaunchIcon = 0 Then
FileDelete(@AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\Winamp.lnk")
EndIf

; Clean eMusic from system after block attempt
$eMusic_Uninstall = RegRead('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\eMusic Promotion', 'UninstallString')
If Not @error Then
; Strip double quotes
_QuoteRemove($eMusic_Uninstall)
; Remove uninstall key if the uninstall file does not exist
If $eMusic_Uninstall <> '' And Not FileExists($eMusic_Uninstall) Then
RegDelete('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\eMusic Promotion')
EndIf
; If eMusic exists and is not a folder then delete it
If FileExists($InstallDir & '\eMusic') And Not StringInStr(FileGetAttrib($InstallDir & '\eMusic'), 'D') Then
FileDelete($InstallDir & '\eMusic')
EndIf
; Remove 50 Free MP3s shortcuts
FileDelete(@ProgramsDir & '\50 Free MP3s +1 Free Audiobook!.lnk')
FileDelete(@ProgramsCommonDir & '\50 Free MP3s +1 Free Audiobook!.lnk')
EndIf

; Stop checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
Sleep(2000)
AdlibDisable()

Exit

Func _Adlib()
; Kill Winamp Remote installation process
ProcessClose("bundle1.exe")
; Kill Mozilla Firefox toolbar installation process
ProcessClose("bundle2.exe")
; Kill Internet Explorer 7 or 8 toolbar installation process
ProcessClose("winamp_toolbar_ie.exe")
; Kill process running in temp directory
ProcessClose('EMusicClient.exe')
EndFunc

Func _QuoteRemove(ByRef $string)
; Remove double quotes from a string stored in a variable
If StringLeft($string, 1) = '"' And StringRight($string, 1) = '"' Then
$string = StringTrimLeft(StringTrimRight($string, 1), 1)
EndIf
EndFunc

Func OnAutoItStart()
; allow only single script instance
If WinExists(@ScriptName & '_Interpreter') Then Exit
AutoItWinSetTitle(@ScriptName & '_Interpreter')
EndFunc

Edit: changed quote change code with StringReplace() on the variable "$eMusic_Uninstall" to intended "_QuoteRemove($eMusic_Uninstall)"

Edited by MHz
Link to comment
Share on other sites

@radix

Your script looks better to use so if I may makes some changes to enhance it some. :)

I have tested with the "winamp5552_full_emusic-7plus_en-us.exe" version of WinAmp so subtle code additions may have been added.

Good work. ;)

Link to comment
Share on other sites

Try again with this:


#RequireAdmin

; Installer file name
$Installer = "winamp5552_pro_all.exe"
; Create Start Menu folder
$StartMenuFolder = 0
; Keep the Desktop icon
$DesktopIcon = 0
; Keep the Quick Launch icon
$QuickLaunchIcon = 0

; Installation folder
$InstallDir = @ProgramFilesDir & "\Winamp"
$PreviousInstallation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winamp", "UninstallString")
_QuoteRemove($PreviousInstallation)
If FileExists($PreviousInstallation) Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of Winamp before using this script", 4)
Exit
EndIf

; create file to block eMusic install folder creation
FileWrite($InstallDir & '\eMusic', 'dummy file')

; Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
AdlibEnable('_Adlib')

; Run the installer
RunWait($Installer & " /S /D=" & $InstallDir)

; Uninstall 50 FREE MP3s +1 Free Audiobook! (bundle3.exe installer work too fast to be stopped)
If FileExists($InstallDir & "\eMusic\Uninst-eMusic-promotion.exe") Then
RunWait($InstallDir & "\eMusic\Uninst-eMusic-promotion.exe" & " /S")
EndIf

; Create Start Menu folder
If $StartMenuFolder = 1 Then
DirCreate(@ProgramsCommonDir & "\Winamp")
FileCreateShortcut($InstallDir & "\UninstWA.exe", @ProgramsCommonDir & "\Winamp\Uninstall Winamp.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\whatsnew.txt", @ProgramsCommonDir & "\Winamp\What's New.lnk", $InstallDir & "\Lang")
FileCreateShortcut($InstallDir & "\winamp.exe", @ProgramsCommonDir & "\Winamp\Winamp.lnk", $InstallDir & "\Lang")
EndIf

; Delete all associated Desktop icons
If $DesktopIcon = 0 Then
FileDelete(@DesktopDir & "\Winamp.lnk")
FileDelete(@DesktopDir & "\Winamp Remote.lnk")
FileDelete(@DesktopDir & "\50 Free MP3s*.lnk")
FileDelete(@DesktopCommonDir & "\Winamp.lnk")
FileDelete(@DesktopCommonDir & "\Winamp Remote.lnk")
FileDelete(@DesktopCommonDir & "\50 Free MP3s*.lnk")
EndIf

; Delete the Quick Launch icon
If $QuickLaunchIcon = 0 Then
FileDelete(@AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\Winamp.lnk")
EndIf

; Clean eMusic from system after block attempt
$eMusic_Uninstall = RegRead('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\eMusic Promotion', 'UninstallString')
If Not @error Then
; Strip double quotes
_QuoteRemove($eMusic_Uninstall)
; Remove uninstall key if the uninstall file does not exist
If $eMusic_Uninstall <> '' And Not FileExists($eMusic_Uninstall) Then
RegDelete('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\eMusic Promotion')
EndIf
; If eMusic exists and is not a folder then delete it
If FileExists($InstallDir & '\eMusic') And Not StringInStr(FileGetAttrib($InstallDir & '\eMusic'), 'D') Then
FileDelete($InstallDir & '\eMusic')
EndIf
; Remove 50 Free MP3s shortcuts
FileDelete(@ProgramsDir & '\50 Free MP3s +1 Free Audiobook!.lnk')
FileDelete(@ProgramsCommonDir & '\50 Free MP3s +1 Free Audiobook!.lnk')
EndIf

; Stop checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processes
Sleep(2000)
AdlibDisable()

Exit

Func _Adlib()
; Kill Winamp Remote installation process
ProcessClose("bundle1.exe")
; Kill Mozilla Firefox toolbar installation process
ProcessClose("bundle2.exe")
; Kill Internet Explorer 7 or 8 toolbar installation process
ProcessClose("winamp_toolbar_ie.exe")
; Kill process running in temp directory
ProcessClose('EMusicClient.exe')
EndFunc

Func _QuoteRemove(ByRef $string)
; Remove double quotes from a string stored in a variable
If StringLeft($string, 1) = '"' And StringRight($string, 1) = '"' Then
$string = StringTrimLeft(StringTrimRight($string, 1), 1)
EndIf
EndFunc

Func OnAutoItStart()
; allow only single script instance
If WinExists(@ScriptName & '_Interpreter') Then Exit
AutoItWinSetTitle(@ScriptName & '_Interpreter')
EndFunc

Edit: changed quote change code with StringReplace() on the variable "$eMusic_Uninstall" to intended "_QuoteRemove($eMusic_Uninstall)"

Thanks guys, I appreciate everything you have done:) One thing to Winamp icon on the desktop, but it is not the whole world, can make a batch script to delete the

DEL "%AllUsersProfile%\Skrivbord\Winamp.ink"

Link to comment
Share on other sites

Thanks guys, I appreciate everything you have done:) One thing to Winamp icon on the desktop, but it is not the whole world, can make a batch script to delete the

DEL "%AllUsersProfile%\Skrivbord\Winamp.ink"

The path used in your CMD script seems strange for a desktop shortcut path.

If you will check the additions that I added to the previous script from radix, then you notice that removal of all associated desktop shortcuts are removed by the code block shown below

; Delete all associated Desktop icons

If $DesktopIcon = 0 Then

FileDelete(@DesktopDir & "\Winamp.lnk")

FileDelete(@DesktopDir & "\Winamp Remote.lnk")

FileDelete(@DesktopDir & "\50 Free MP3s*.lnk")

FileDelete(@DesktopCommonDir & "\Winamp.lnk")

FileDelete(@DesktopCommonDir & "\Winamp Remote.lnk")

FileDelete(@DesktopCommonDir & "\50 Free MP3s*.lnk")

EndIf

So, is there an issue with a WinAmp desktop shortcut still existing after execution of the script?

Link to comment
Share on other sites

  • 3 weeks later...
Thanks guys, I appreciate everything you have done:) One thing to Winamp icon on the desktop, but it is not the whole world, can make a batch script to delete the

DEL "%AllUsersProfile%\Skrivbord\Winamp.ink"

The path used in your CMD script seems strange for a desktop shortcut path.

If you will check the additions that I added to the previous script from radix, then you notice that removal of all associated desktop shortcuts are removed by the code block shown below

; Delete all associated Desktop icons

If $DesktopIcon = 0 Then

FileDelete(@DesktopDir & "\Winamp.lnk")

FileDelete(@DesktopDir & "\Winamp Remote.lnk")

FileDelete(@DesktopDir & "\50 Free MP3s*.lnk")

FileDelete(@DesktopCommonDir & "\Winamp.lnk")

FileDelete(@DesktopCommonDir & "\Winamp Remote.lnk")

FileDelete(@DesktopCommonDir & "\50 Free MP3s*.lnk")

EndIf

So, is there an issue with a WinAmp desktop shortcut still existing after execution of the script?

It does not erase the icon on the desktop :(

Edited by smeko
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
  • Recently Browsing   0 members

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