Jump to content

MHz

Member
  • Posts

    1,691
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Australia

Posts posted by MHz

  1. ... I get a compile error "no brackets allowed in subroutine call" or something like that. (german windows xp)

    You will find that subroutines do not return a value so do not use brackets. On the use of functions with storing the returned value into a variable, then you may need to use brackets. I keep to that concept and has proven consistent with good results.

    So this should be fine

    subroutine "parameter"

    and this

    variable = function("parameter")

    The below (reversed usage of brackets) will occur error that I would expect.

    subroutine ("parameter")

    and this

    variable = function "parameter"

    So if it returns a value, then use brackets, else do not. I'm not sure by my memory atm about the following, but if you do not store the value of a function return, then do not use brackets (like a subroutines behavior) to avoid error. A function may require brackets if used with an IF statement like below to also avoid error.

    If function("parameter") Then

    Edit:

    Added last sentence about using IF statement

  2. can not download Cmenu

    Kaspersky Anti-Virus 6.0 for Windows Workstations

    The requested URL http://dc95.4shared.com/download/24098929/...103423-b58cd80c is infected with not-a-virus:Monitor.Win32.Hooker.s virus

    I sent a request to Kaspersky Virus Lab to check for being false positive.

    Thank you

    Edit:

    I have been informed that the message is a warning only as the keywords in the description are "not a virus". The file that is being flagged is TheHook.dll which is used by AutoItMacroGenerator02.exe to enable the recording ability of the desktop shell. To the best of my knowledge, AutoItMacroGenerator02.exe is not using the TheHook.dll in a malicious manner. The warning is shown and the end user needs to decide whether to trust.

    Hello,

    CMenu.exe_.AutoIt.AMG.TheHook.dll - not-a-virus:Monitor.Win32.Hooker.s

    This file is already detected by our extended bases as a potentially risk program.

    Please quote all when answering.

    The answer is relevant to the latest bases from update sources.

    Your program uses a library which might be (or is) also used by malicious programs. As you see, the detection reads "not a virus", so it's just a warning. For instance RAdmin or mIRC are detected in a similiar way.

    To avoid detection, consider moving the functions you need from the dll in question to the main executable

    I have found a file which seems to be source code for that dll: http://basic-compiler.com/mla/2003-March/013507.html - hope that helps.

    > >

    > > LANG: en

    > > email: <removed for personal reasons>

    > > product: Kaspersky Anti-Virus 6.0 for Windows Workstations

    > > viruses_date:

    > >

    > > description:

    > > Hi, I am Michael Heath. I am the author of a shell extension program named CMenu. I received an alert from a forum member at MSFN about the virus alert on CMenu. Oddly enough the file on site is scanned by Kaspersky Anti-Virus and is marked as OK.

    > > The complaint was posted here http://www.msfn.org/board/index.php?showto...st&p=865244 at post #156.

    > > The link to download CMenu from is http://www.4shared.com/file/24098929/6b0f0...l?cau2=403tNull

    > > CMenu.exe is an AutoIt compiled executable. Please check for false positive virus detection.

    > >

    Best regards, Maxim Makhotkin

    Malware Analyst

    Kaspersky lab

    10/1, 1st Volokolamsky Proezd, Moscow, 123060, Russia

    Tel./Fax: + 7 (495) 797 8700

    http://www.kaspersky.com http://www.viruslist.com

  3. Then i open ''SciTE Script Editor'' and i paste the code inside it. I save & compile the file. The ''Autoit3Wrapper Window'' doesn't appear as shown at the guide.

    If you have the full Scite4AutoIt3 editor installed then selecting "Compile" (Ctrl+F7) will show the dialog else selecting "Build" (F7) will compile without prompt (as long as no errors are detected).

    Anyway,I've used the compiled exe file with WPI...the avira_antivir_personal_en gets unpacked but it stacked to the first ''next button''.

    Any help is appreciated because i am not familiar with AutoIt..;?

    With some changes to the code you posted, the script worked for me.

    Stopping at the 1st window may have been because the window did not activate. My changes to the code forces the window to activate.

    The Do Untill loop is illogical as 1 will never equal 2 and no condition allows the exit of the loop so the loop will forever loop. i replaced the loop as I do not see a need for a loop with the code.

    The code shows a lack of using the text parameters and I would advise the use of them to ensure the script operates with the correct window with each execution. I have not done the previous mention of text parameter changes so you can use some time to improve on this.

    Posted script with changes made


    #RequireAdmin

    If WinExists(@ScriptName) Then Exit

    AutoItWinSetTitle(@ScriptName)
    AutoItSetOption("TrayIconDebug", 1)
    ; AutoItSetOption("SendKeyDelay", 20)

    Global $title = 'Avira AntiVir Personal - Free Antivirus'
    Global $file = 'avira_antivir_personal_en.exe'

    ; Use quoted double quotes to prevent issues with spaces in the path
    $pid = Run('"' & @ScriptDir & '\' & $file & '"')
    If @error Then Exit 1

    ; WinWait is usually adequate for Control* functions to operate correct
    WinWait($title, "")
    ControlClick($title, "Continue", "Button1")

    WinWait($title, "This wizard will install Avira AntiVir Personal")
    Send("!n")

    WinWait($title, "")
    ControlClick($title, "&Next >", "Button2")

    ; Ensure window is active for Send function to operate correct
    _WinWaitActive($title, "Licence agreement Avira AntiVir Personal")
    Send("!a")
    ControlClick($title, "&Next >", "Button3")

    WinWait($title, "Please confirm that you will use"); ...not for commercial use
    ControlClick($title, "", "Button2")
    ControlClick($title, "&Next >", "Button5")

    WinWait($title, "Select the program features you want to install")
    ControlClick($title, "C&omplete", "Button1")
    ControlClick($title, "&Next >", "Button7")

    WinWait($title, "Yes, I would like to subscribe to the Avira newsletter")
    ControlClick($title, "", "Button2")
    ControlClick($title, "&Next >", "Button5")

    WinWait($title, "Installation complete")
    ControlClick($title, "Show readme.txt", "Button1")
    ControlClick($title, "Finish", "Button12")

    ; Wait for up to 60 seconds for config window
    If WinWait("Configuration wizard", "", 60) Then
    ControlClick("Configuration wizard", "", "Button2")

    WinWait("Configuration wizard", "")
    ControlClick("Configuration wizard", "", "Button6")

    WinWait("Configuration wizard", "")
    ControlClick("Configuration wizard", "", "Button8")

    WinWait("Configuration wizard", "")
    ControlClick("Configuration wizard", "", "Button10")

    WinWait("Configuration wizard", "")
    ControlClick("Configuration wizard", "", "Button1")

    WinWait("Configuration wizard", "")
    ControlClick("Configuration wizard", "", "Button11")

    WinWait("Configuration wizard", "You have now specified the basic configuration")
    ControlClick("Configuration wizard", "", "Button12")
    EndIf

    ; Wait up to 60 seconds for previous Run process to close
    ProcessWaitClose($pid, 60)

    Exit

    Func _WinWaitActive($title, $text = '')
    ; Window wait, activate and then wait until active
    WinWait($title, $text)
    WinActivate($title, $text)
    WinWaitActive($title, $text)
    EndFunc

  4. If you go into the help menu of MPC (I have the mpc homecinema version so hopefully same), you will see a "Command Line Switches" entry which pops up a window with all switches available to pass to mplayerc.exe. Use the switch "/regvid" to associate all video types to MPC. You could try to run the command from a NSIS script or do it with an external command after installation.

  5. 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?

  6. 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)"

  7. 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

  8. Hi from Australia :)

    I am not sure if I understand correct but perhaps this may help you. It is cleaned up and added some possible improvements.


    Opt("WinWaitDelay", 100)
    Opt("WinTitleMatchMode", 4)
    Opt("WinDetectHiddenText", 1)
    Opt("MouseCoordMode", 0)

    ; close instance of bsplayer.exe
    If ProcessExists("bsplayer.exe") Then
    ProcessClose("bsplayer.exe")
    EndIf

    ; use quoted double quotes with paths that contain spaces
    $pid = Run('"BSPlayer PRO 2.27.959.exe"')
    ; if Run() sets @error then exit
    If @error Then Exit 1

    _WinWaitActive("BS.Player PRO Setup", "Please review the li")
    Send("{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Welcome to the BS.Pl")
    Send("{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Choose which feature")
    Send("{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Choose Install Locat")
    Send("{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Additional install o")
    Send("{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Select default langu")
    Send("{DOWN 23}{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Installation Complet")
    Send("{ENTER}")
    _WinWaitActive("BS.Player PRO Setup", "Completing the BS.Pl")
    Send("{ENTER}")
    _WinWaitActive("Información de Registro", " Registro de BSp")
    Send("{SHIFTDOWN}xxx{SHIFTUP}xxxxx{TAB}xxxxxxxxxx{ENTER}{TAB}{ENTER}")
    _WinWaitActive("Información", "Gracias por registra")
    Send("{ENTER}")

    ;Cierra Aplicacion
    ProcessWait("bsplayer.exe", 10)
    ProcessClose("bsplayer.exe")
    ProcessWaitClose($pid)

    Exit

    Func OnAutoItStart()
    ; run one 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

  9. Hi Alpha_95

    I do not have version 7 but I would presume that the installer type and techniques are the same as previous builds. The Nullsoft Scriptable Install System (NSIS) is used by most install package creators to follow the standard methods. Since NSIS can be customized then this allows some install package creators to be more inconsiderate towards the end-users and create unfriendly installers.

    CMenu identified the installer correct but the install package creator chose that you get what they customized with using NSIS. The DivX.com organization has chosen to be like this since they became a commercial entity.

    If you are interested in just the codec to decode and/or encode then I would suggest XviD or Ffdshow which are Inno Setup installers that give you the freedom to install with standard switches that Inno Setup offers. Either of the above will handle DixX files. Ffdshow handles many more codec types as well which you may know as a bundle of codecs.

    If you wish to persist with the DivX installer then you can search for AutoIt automated scripts posted in the forum or perhaps repack the installer and make it more friendly to install.

    Edit: Added missing word from a sentence

  10. Hi,

    An ini file is a txt file that is structured to get and/or store information easily so I would be recommending that method to you unless you have special needs.

    example code


    ; ini file name to use
    $file_ini = 'my program settings.ini'

    ; create ini file if not exists
    If Not FileExists($file_ini) Then
    IniWrite($file_ini, 'gmail', 'username', '')
    IniWrite($file_ini, 'gmail', 'password', '')
    EndIf

    ; read ini file values form gmail section
    $username = IniRead($file_ini, 'gmail', 'username', '')
    $password = IniRead($file_ini, 'gmail', 'password', '')

    ; show result
    MsgBox(0, Default, '$username = ' & $username & @CRLF & '$password = ' & $password)

    ; example of checking for non empty values for both values
    If $username <> '' And $password <> '' Then
    MsgBox(0, Default, 'both variables have values worth using')
    EndIf

  11. ...

    PS I would like to use WHILE/WEND, I do not wish to learn DO/WHILE just yet.

    The reason that WHILE/WEND was outed in "VBScript" as it is tested once at the start. DO/WHILE also gives the option at the start or end of the loop. When tested "Do While" or "Loop While" gives more options for you as a programmer.

    Edit: Keyword change

  12. The dialogs already exist during setup so I fail to see the relevance stated about "slowing" down the install. The dialogs are behind the billboard that covers them up. Info here shows you how to remove the billboard so the dialogs are seen without any other action needed nor any resources wasted.

    Here is an AutoIt script that may help if you want to keep the billboard. Changes maybe needed depending on the state and reaction of the windows. Resources wasted would be very little to notice.

    $title = 'Windows XP Professional Setup'
    _WinWaitSetState($title, 'Installing Devices')
    _WinWaitSetState($title, 'Network Settings')
    _WinWaitSetState($title, 'Installing Components')
    _WinWaitSetState($title, 'Performing Final Tasks')

    Exit

    Func _WinWaitSetState($title, $text = '', $flag = @SW_SHOW)
    WinWait($title, $text)
    WinSetState($title, $text, $flag)
    WinActivate($title, $text)
    EndFunc

  13. Another option. Using CMD in WinNT based systems is safe to use multiline statements so this avoids the goto feature.

    %systemroot%\system32\msiexec.exe /q /x {76B2BC31-2D96-4170-9C44-09E13B5555F3} /norestart
    If Not Exist "%Programfiles%\Sophos\savmain.exe" (
    \\ln-co-avs01\InterChk\ESXP\setup.exe -mng yes -user domain\username -pwd Pass#123 -s
    )

    Using Start /Wait is another option that gunsmokingman mentions that could be needed though I test without first up to see if successful.

    You can use the command 'If /?' at a command prompt to learn the usage of 'If'. 'Goto' is rather redundant in many of the latest programming languages so is perhaps good to avoid using if possible IMO unless you service 9x or earlier systems with scripts.

  14. I had previously used the Text to Speech UDF available on Autoit forums in a QC application. It does work but were some bugs iirc.

    Sorry for late reply. I would like to comment that using XP 32 bit I had no problems at all with scripting SAPI with AutoIt or VBScript. Under Vista 32 Bit is little joy as the sound drivers that I have are not good in certain sound generation methods used. I use the Creative card and drivers that are not quite there yet for the card that i have. Perhaps some similar issues is your recognition of disappointment with using scripts to using SAPI?

  15. You can use VBScript or AutoIt 3 to access the SAPI object.

    Here is a AutoIt example that can be compiled to say.exe and use a CLI switch to run it i.e. say.exe "this is a test parameter". The VBScript syntax is similar to translate to.


    If $CMDLINE[0] = 1 Then
    ; call function using cli parameter
    _Say($CMDLINE[1], 1, 100)
    Else
    ; else call function with a warning
    _Say('No parameters used')
    EndIf

    Func _Say($sText, $iRate = 1, $iVolume = 100)
    ; use sapi text to speech
    If $iRate > 10 Or $iVolume > 100 Then Return
    Local $oTalk = ObjCreate('SAPI.SpVoice')
    If Not @error Then
    With $oTalk
    .Rate = $iRate
    .Volume = $iVolume
    .Speak($sText, 1)
    .WaitUntilDone(500)
    .Pause()
    Sleep(1000)
    .Resume()
    .WaitUntilDone(-1)
    EndWith
    EndIf
    EndFunc

    :)

  16. ... i want to know if there is any way to do that the two archives be only one, only the Unntended.exe.

    I believe that iamtheky was refering to a script like this


    ; extract Alcohol installer from the AutoIt executable and put it in the temp folder
    If FileInstall("Alcohol1.9.8.7117.exe", @TempDir & '\Alcohol1.9.8.7117.exe') Then
    ; execute Alcohol installer with silent switches
    RunWait('"' & @TempDir & '\Alcohol1.9.8.7117.exe" /qn /REBOOT=ReallySuppress', @TempDir)
    ; pause for half second
    Sleep(500)
    ; remove temp copy of Alcohol installer
    FileDelete(@TempDir & '\Alcohol1.9.8.7117.exe')
    EndIf

    The Alcohol installer is stored with in the AutoIt created executable when compiled. This means that you only need the AutoIt executable and not the Alcohol installer as the Alcohol installer is with in the AutoIt executable and the Alcohol installer will be extracted to Temp dir when executed and will install Alcohol and then delete the Alcohol installer.

    :)

  17. ...

    All goes well until it gets to the window that asks if I want to do a complete or custom install. This window is no different then any of the previous windows with one exception. Between the previous page and this one you can see another window/process run really fact and disappear. How can I get around this?

    ...

    The window that appears briefly is probably stealing focus from your waiting window and since you make no attempt to activate the window then your script may stall in waiting for the window to activate. You do not seem to require the window to be active as you are using ControlClick() only so you may just use WinWait() instead of WinWaitAcitive(). If you want to use WinWaitActive() in an unattended install script then I would advise to force activation of the windows to prevent your script from stalling.

    Comments added to code


    $pid = Run("setup.exe")
    ; check error if setup.exe fails
    If Not $pid And @error Then
    Exit 1
    EndIf

    ; use a user defined function to wait, activate and then wait until active with the window
    _WinWaitActive("Choose Setup Language")
    Send("{ENTER}")

    $title = "FileMaker Pro 8.5 Advanced Setup"
    _WinWaitActive($title)
    Sleep(5000)
    ControlClick($title, "Welcome to the InstallShield Wizard for FileMaker Pro 8.5 Advanced", "&Next >")

    _WinWaitActive($title, "Customer Information")
    Send("Admin")
    Send("{TAB 2}")
    Send("36F34" & "69C76" & "E4934" & "8BF70" & "0A54A" & "8FDD3" & "A6C11")
    ControlClick ($title, "Customer Information", "&Next >")

    ; using WinWait with Control* functions as is normally sufficient
    WinWait($title, "License Agreement")
    ControlClick($title, "License Agreement", "I &accept the terms in the license agreement")
    ControlClick($title, "License Agreement", "&Next >")

    WinWait($title, "Destination Folder")
    ControlClick($title, "Destination Folder", "&Next >")

    WinWait($title, "Application Shortcuts")
    ControlClick($title, "Application Shortcuts", "&Next >")

    WinWait($title, "Setup Type")
    ControlClick($title, "Setup Type", "&Next >")

    WinWait($title, "Ready to Install the Program")
    ControlClick($title, "Ready to Install the Program", "&Install")

    WinWait($title, "InstallShield Wizard Completed")
    ControlClick($title, "InstallShield Wizard Completed", "&Finish")

    ; title correction as you may have made an error as titles were different
    WinWait("FileMaker Product Registration")
    ControlClick("FileMaker Product Registration", "", "&Cancel")

    WinWait("Registration is not completed")
    ControlClick("Registration is not completed", "", "&Yes")

    ; a process may take a moment to finish after the last window so added a wait
    ProcessWaitClose($pid, 10)

    Exit

    Func _WinWaitActive($title, $text = "")
    ; UDF to wait, activate and wait until active
    WinWait($title, $text)
    Sleep(250)
    WinActivate($title, $text)
    WinWaitActive($title, $text)
    EndFunc

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

    I replaced the common title string with the variable $title to account for the repetition.

    :)

  18. I would look use the switch -uv for it's mention of DVD compatibility but it mentions to not be combined with other mentioned switches which you display in your command line usage.

    -uv

    Specifies UDF Video Zone compatibility during DVD Video/Audio disk creation. This means UDF 1.02 and ISO 9660 are written to the disk. Also, all files in the VIDEO_TS, AUDIO_TS, and JACKET_P directories are written first. These directories take precedence over all other ordering rules used for this image. This option cannot be combined with the -n, -nt, -d, -j1, -j2, -js, -u1, -u2, -ur, -us, -ue, -uf, or -yl options.

    AFAIK, OSCDIMG 2.54 is similar to CDIMAGE 2.54. ImageX is possibly the latest OS imager that MS uses though it may not suit your needs with Video DVDs.

    :)

  19. I'm stuck in getting it to display the helpfile when double click the complied exe (DVDTray.exe) w/o any parameters.

    (I understand help file is display via cmdline using DVDtray /?)

    This conditional test is for checking if command line parameters were used and if so will be non zero.


    If $CMDLINE[0] then
    Switch $CMDLINE[1]
    Case 'help', '/?', '-?', '/help'
    _DisplayHELP()
    Case 'open'
    ToolTip ( "Ejecting "&$DVDLetter&" tray...", @DesktopWidth/2 , @DesktopHeight/2 , "DVDTray" , 0,1 )
    CDTray($DVDLetter, 'open')
    Case 'close'
    ToolTip ( "Closing "&$DVDLetter&" tray...", @DesktopWidth/2 , @DesktopHeight/2 , "DVDTray" , 0,1 )
    CDTray($DVDLetter, 'closed')
    EndSwitch
    Else
    _DisplayHELP()
    Endif

    And you could add a Case Else condition to show help if a unrecognized command line parameter was passed.


    If $CMDLINE[0] then
    Switch $CMDLINE[1]
    Case 'help', '/?', '-?', '/help'
    _DisplayHELP()
    Case 'open'
    ToolTip ( "Ejecting "&$DVDLetter&" tray...", @DesktopWidth/2 , @DesktopHeight/2 , "DVDTray" , 0,1 )
    CDTray($DVDLetter, 'open')
    Case 'close'
    ToolTip ( "Closing "&$DVDLetter&" tray...", @DesktopWidth/2 , @DesktopHeight/2 , "DVDTray" , 0,1 )
    CDTray($DVDLetter, 'closed')
    Case Else
    _DisplayHELP()
    EndSwitch
    Else
    _DisplayHELP()
    Endif

    :)

  20. Hi bingelman,

    I am going to guess what you are referring to as your explanation seems very brief. There are 2 types of installs that support recording, being Inno Setup and InstallShield. The configuration file for Inno Setup is read when the AutoIt script is generated. The configuration file can then be discarded. The configuration file for InstallShield is used depending on the script generated as the setup maybe packed or unpacked.

    If you would like, then just PM me the script generated and I will have a look at it to allow me to give you some better advise.

    :)

  21. ...

    If I have an application running (Active) that uses it's own F8-F9 commands how do I get my program to bypass that applications use of the F8-F9 keys?

    I am not sure what application and hotkeys has to do with an installation. Overriding hotkeys seems like acting against the flow so may I suggest asking these general questions at the AutoIt Forums where someone experienced with hotkeys and any other general questions can answer you.

  22. I can not get 2 While Statement to run at the same time. How can I achieve this?

    A function needs to return before you can call another function so that hinders your attempt. AutoIt3 runs code from a script line by line so trying to run 2 blocks of code at the exact same time cannot be done unless timers or other is used. The easiest solution would be to rearrange your code to use 1 loop to handle the conditions of concern at that time.


    #include <GuiConstants.au3>
    Dim $MID, $Color
    HotKeySet('{F8}', '_HotKeyPressed')
    HotKeySet('{F9}', '_HotKeyPressed')

    Opt('MouseCoordMode', 1)
    Opt('PixelCoordMode', 1)

    GUICreate('Test', 300, 100)
    $label_coords = GUICtrlCreateLabel('Mouse coordinates:', 20, 20, 260, 20)
    $label_color = GUICtrlCreateLabel('Hex color:', 20, 50, 260, 20)
    GUISetState()

    While 1
    If GUIGetMsg() = -3 Then
    ExitLoop
    EndIf
    $pos = MouseGetPos()
    $var = PixelGetColor($pos[0], $pos[1])
    If $MID Then
    GUICtrlSetData($label_coords, 'Mouse coordinates: X = ' & $pos[0] & ' Y = ' & $pos[1])
    EndIf
    If $Color Then
    GUICtrlSetData($label_color, 'Hex color: ' & Hex($var, 6))
    EndIf
    WEnd

    Func _HotKeyPressed()
    If @HotKeyPressed = '{F8}' Then
    $MID = Not $MID
    ElseIf @HotKeyPressed = '{F9}' Then
    $Color = Not $Color
    EndIf
    EndFunc

×
×
  • Create New...