Jump to content

FileInstall to extract to %Temp%\data folder?


Recommended Posts

I need help understanding how to use environment vars in AutoIt currently while im trying to compile a script I want to use FileInstall and I know how to use that but not understanding how to use it when I want the extract path to be the users %temp%\data folder? the data folder will be created when extracting the content. So that later I can use the RunWait function of the extracted file/files!

I tried to read FileInstall and @tempdir and a few others but non give examples with a $var in the FileInstall extract path.

Thanks,

MrChris

Edited by MrChris
Link to comment
Share on other sites

An example

; Variable is assigned
$var = @TempDir & '\data'

; Create the folder
If DirCreate($var) Then

    ; Extract the file to the folder (trailing backslash used a is a File* function)
    If FileInstall('file.exe', $var & '\') Then

        ; Execute the extracted file
        RunWait($var & '\file.exe')

        ; Remove the directory from the themp folder
        DirRemove($var, 1)

    EndIf
EndIf

:D

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