Jump to content

Recommended Posts

Posted

stuck on one last little thing, my .exe will only execute this part of the code if it is run from my c: drive (Win7 x64).

Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW)

if it is run from any other drive, it just hangs there and does nothing. Is there something better then @WorkingDir??

Posted

  On 5/12/2010 at 5:45 AM, 'hawky358 said:

I assume you mean the folder in which the script is?

Use @scriptdir

yes, within the folder my .exe is run is another program (from $SDDBname) that needs to be run. just tried @ScriptDir and it has the same problem, works fine on C: drive but not any other drive (internal or external).

Posted

this is the whole function:

Func downloadSDDB()
    If $iniArray[8][0] = 1 Then  ; If "SD+AV Databases" is ticked
        $stringSplitArray = StringSplit(($iniArray[8][2]), "/") 
        $SDDBname = $stringSplitArray[$stringSplitArray[0]] 
        Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW)
        WinWaitActive("Setup - Signature Database Download")
        Send("{ENTER}")
        WinWaitActive("Setup - Signature Database Download", "Signature Database Download Complete")
        Send("{ENTER}")
    EndIf
EndFunc

this being my first script, there is probably better ways of doing these things, but it all works great apart from this 'Run' only working on c: drive. I just tested on my housemates PC, also a Win7 x64, and the same problem there, only works on c: drive.

thanks for any advice.

Posted

interesting, I just tried on my netbook in Win7 Starter x86 and WinXP x86 and it WORKED in both when running from an ext hdd. Is this some kind of 64bit problem?

Posted

As the command to be run is "calculated" during run time make sure the variable has the desired value.

Func downloadSDDB()
    If $iniArray[8][0] = 1 Then ; If "SD+AV Databases" is ticked
        $stringSplitArray = StringSplit(($iniArray[8][2]), "/") 
        $SDDBname = $stringSplitArray[$stringSplitArray[0]] 
        MsgBox(0,"","WorkingDir: " & @WorkingDir & @CRLF & "$SDDBName: " & $SDDBName)   ; <== Inserted
        Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW)
        WinWaitActive("Setup - Signature Database Download")
        Send("{ENTER}")
        WinWaitActive("Setup - Signature Database Download", "Signature Database Download Complete")
        Send("{ENTER}")
    EndIf
EndFunc

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

getting more interesting, i inserted that extra line, the MsgBox clearly displayed exactly what I have been wanting it to do all along, and when i clicked OK... it ran! maybe it just needs a small delay for some reason...

Posted

Ok, I have managed to get this to run correctly on ext hdd by adding a 2 second sleep in between calculating the filename and executing it. weird, but it works. I increased a few hundred ms at a time and when i got to 2000 it worked straight away.

Func downloadSDDB()
    If $iniArray[8][0] = 1 Then  ; If "SD+AV Databases" is ticked
        $stringSplitArray = StringSplit(($iniArray[8][2]), "/") 
        $SDDBname = $stringSplitArray[$stringSplitArray[0]] 
        Sleep(2000)
        Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW)
        WinWaitActive("Setup - Signature Database Download")
        Send("{ENTER}")
        WinWaitActive("Setup - Signature Database Download", "Signature Database Download Complete")
        Send("{ENTER}")
    EndIf
EndFunc

thanks to water. it was your informational MsgBox line that got me on the track to a solution.

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