May 3, 200917 yr 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 removedI hope someone can help me Install.au3 Edited May 3, 200917 yr by smeko
May 4, 200917 yr 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).#RequireAdminOpt ('SendKeyDelay', 1500); pauses between sent keystrokesOpt ('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 klarSleep(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 itIf ProcessWait('winamp.exe', 120) Then For $i = 1 To 2 ProcessClose('winamp.exe') If Not ProcessExists('winamp.exe') Then ExitLoop EndIf Sleep(1000) NextEndIfExitFunc OnAutoItStart() ; single script instance only If WinExists(@ScriptName & '_Interpreter') Then Exit AutoItWinSetTitle(@ScriptName & '_Interpreter')EndFuncFunc _WinWaitActive($title, $text = '') ; window wait functions WinWait($title, $text) WinActivate($title, $text) WinWaitActive($title, $text)EndFunc
May 4, 200917 yr 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)EndIfIf StringLeft($PreviousInstallation, 1) = '"' Then $PreviousInstallation = StringTrimLeft($PreviousInstallation, 1)EndIfIf FileExists($PreviousInstallation) Then MsgBox(0x40010, @ScriptName, "Please uninstall previous version of Winamp before using this script", 4) ExitEndIf; Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processesAdlibEnable('_Adlib'); Run the installerRunWait($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 folderIf $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 iconIf $DesktopIcon = 0 Then FileDelete(@DesktopCommonDir & "\Winamp.lnk")EndIf; Delete the Quick Launch iconIf $QuickLaunchIcon = 0 Then FileDelete(@AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\Winamp.lnk")EndIfSleep(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 processesAdlibDisable(); 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 NextEndIf$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 NextEndIfFunc _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")EndFuncSilent installation, all icons, Winamp Remote and toolbars will be removed. Edited May 4, 200917 yr by radix
May 5, 200917 yr Author Hello Radix and MHZ againIm 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 codeHere is Radix Code: Using Winamp.exe /SAnd 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
May 5, 200917 yr 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)EndIfIf StringLeft($PreviousInstallation, 1) = '"' Then$PreviousInstallation = StringTrimLeft($PreviousInstallation, 1)EndIfIf FileExists($PreviousInstallation) ThenMsgBox(0x40010, @ScriptName, "Please uninstall previous version of Winamp before using this script", 4)ExitEndIf; Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processesAdlibEnable('_Adlib'); Run the installerRunWait($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 folderIf $StartMenuFolder = 1 ThenDirCreate(@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 iconIf $DesktopIcon = 0 ThenFileDelete(@DesktopCommonDir & "\Winamp.lnk")EndIf; Delete the Quick Launch iconIf $QuickLaunchIcon = 0 ThenFileDelete(@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 processesAdlibDisable()Func _Adlib(); Kill Winamp Remote installation processProcessClose("bundle1.exe"); Kill Mozilla Firefox toolbar installation processProcessClose("bundle2.exe"); Kill Internet Explorer 7 or 8 toolbar installation processProcessClose("winamp_toolbar_ie.exe")EndFunc Edited May 5, 200917 yr by radix
May 6, 200917 yr 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) ExitEndIf; create file to block eMusic install folder creationFileWrite($InstallDir & '\eMusic', 'dummy file'); Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processesAdlibEnable('_Adlib'); Run the installerRunWait($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 folderIf $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 iconsIf $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 iconIf $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 processesSleep(2000)AdlibDisable()ExitFunc _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')EndFuncFunc _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) EndIfEndFuncFunc OnAutoItStart() ; allow only single script instance If WinExists(@ScriptName & '_Interpreter') Then Exit AutoItWinSetTitle(@ScriptName & '_Interpreter')EndFuncEdit: changed quote change code with StringReplace() on the variable "$eMusic_Uninstall" to intended "_QuoteRemove($eMusic_Uninstall)" Edited May 6, 200917 yr by MHz
May 6, 200917 yr @radixYour 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.
May 6, 200917 yr Author 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) ExitEndIf; create file to block eMusic install folder creationFileWrite($InstallDir & '\eMusic', 'dummy file'); Start checking for Winamp Remote, Mozilla Firefox toolbar and Internet Explorer (7 or 8) toolbar installation processesAdlibEnable('_Adlib'); Run the installerRunWait($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 folderIf $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 iconsIf $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 iconIf $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 processesSleep(2000)AdlibDisable()ExitFunc _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')EndFuncFunc _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) EndIfEndFuncFunc OnAutoItStart() ; allow only single script instance If WinExists(@ScriptName & '_Interpreter') Then Exit AutoItWinSetTitle(@ScriptName & '_Interpreter')EndFuncEdit: 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 theDEL "%AllUsersProfile%\Skrivbord\Winamp.ink"
May 7, 200917 yr DEL "%AllUsersProfile%\Skrivbord\Winamp.ink"We can write a function which search and delete that icon.
May 7, 200917 yr 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 theDEL "%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 iconsIf $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")EndIfSo, is there an issue with a WinAmp desktop shortcut still existing after execution of the script?
May 29, 200917 yr Author 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 theDEL "%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 iconsIf $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")EndIfSo, 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 May 29, 200917 yr by smeko
Create an account or sign in to comment