Jump to content
Sign in to follow this  
KaFu

au3 x64-Switch Wrapper

Recommended Posts

KaFu

Hello Forum,

together with Melba23 I wrote the ICU - Icon Configuration Utility. As this app accesses the desktop listview, it needs to be compiled in line with the @OSArch to be able to access the OS listview.

For the next release I was thinking about adding a wrapper to include the x86 and the x64 exe in one file. I came up with the following solution:

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=au3_x64_switcher.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

If @OSArch = "X86" Then
    $sFilename = @ScriptDir & "\au3_32bit.exe"
    FileInstall("bins\au3_32bit.exe", $sFilename)
Else
    $sFilename = @ScriptDir & "\au3_64bit.exe"
    FileInstall("bins\au3_64bit.exe", $sFilename)
EndIf

If Not FileExists($sFilename) Then _Exit("Could not extract temporary file to" & @CRLF & @CRLF & $sFilename)

$iPID = RunWait(FileGetShortName($sFilename) & " " & $CmdLineRaw, @ScriptDir)

$timer = TimerInit()
While FileExists($sFilename)
    If TimerDiff($timer) > 5000 Then
        _Exit("Could not delete temporary extracted file" & @CRLF & @CRLF & $sFilename)
    EndIf
    FileDelete($sFilename)
    Sleep(250)
WEnd

Func _Exit($sMsg = "")
    If $sMsg Then MsgBox(16 + 262144, "Error", $sMsg)
    Exit
EndFunc   ;==>_Exit

I would be glad about any feedback on possibilities to improve this simple one :idea:.

Regards

Edited by KaFu

Share this post


Link to post
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
Sign in to follow this  

×