When I run my script without compiling it, it works just fine.
When I compile the script and run it this part of the script doesn't run properly. Here's my terrible explanation of what's supposed to happen but doesn't once its compiled.
I have part of the script call the Function _Update well once it calls _Update it runs ShellExecute("C:\Test\test\run\Email.au3") immediately and doesn't wait 5 minutes.
$iMinutes = 5 $hTimer = TimerInit() Func _Update() AdlibRegister(_Update, 2000) If TimerDiff($hTimer) > ($iMinutes * 60000) And ProcessExists($recheck) Then ;ConsoleWrite("5 minutes have passed!" & @CRLF) ShellExecute("C:\Test\test\run\Email.au3") AdlibUnRegister(_Update) $hTimer = TimerInit() ElseIf Not ProcessExists($recheck) Then AdlibUnRegister(_Update) EndIf EndFunc Anyone have any suggestions on what I can do to fix this?
I have an issue with compiling a file from inside a script using 22.214.171.124.
The script is kind of long so I will try to paraphrase what is happening.
First, I get the compiler locations and store them in variables:
Global $compileExe86 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Aut2Exe.exe", "") Global $compileExe64 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Aut2Exe_x64.exe", "") Then later I parse an array within a function to compile a list of files one at a time. The function accepts "x86" for files to be compiles as x86 and "x64" for 64-bit compiling.
If $s_arch = "x86" Then $s_action = "/in " & @ScriptDir & "\" & $a_CompileFiles[$i] & " /out " & @ScriptDir & "\" & $a_CompileFiles[$i] & "\" & StringReplace($a_CompileFiles[$i], ".au3", ".exe") & " /pack /comp 4 /icon " & $icon ; x86 ElseIf $s_arch = "x64" Then $s_action = "/in " & @ScriptDir & "\" & $a_CompileFiles[$i] & " /out " & @ScriptDir & "\" & $a_CompileFiles[$i] & "\" & StringReplace($a_CompileFiles[$i], ".au3", ".exe") & " /pack /comp 4 /icon " & $icon & " /x64" ; x64 EndIf $s_err = ShellExecuteWait($compileExe, $s_action, @ScriptDir, $SHEX_OPEN, @SW_HIDE) The problem is that $s_err will return 0 if the file is compiled successfully or not - for example, if one of the files uses FileInstall() but the file to be installed is not present, I still get a return of 0, but if I compile the same file from the command line I get a return of 3 as the errorlevel.
This happens even though Aut2Exe is popping up an error dialog that has to be confirmed.
I also tried with RunWait and got the same result.
Is this a known issue?
Backstory to understand my need:
I'm building something similar to what Chunk VNC was, using the Single Click function from UltraVNC to provide remote support.
My "little monster" is actually working, but the "solution" will have 3 modules:
SUPPORT: Users will open or install so IT Pros can access their system. VIEWER: IT Pros use to connect to User systems and perform their maintenance GENERATOR: The IT Pro uses to define the configuration for both the SUPPORT and VIEWER apps, like language files for text, SERVER address and ports, Company name, etc. I've attached a screenshot of the SUPPORT app that is done.
Before anyone points the finger, no I'm not planning on just copying the AutoIt3 files to my project folder and distribute them, I intend to get the IT Pro who will use the GENERATOR to install SciTE and AutoIt3 then the GENERATOR will use them to compile the other two apps.
The thing is, I need this to be simple, I thought about the GENERATOR having a single screen where the IT Pro can fill in all the information, select the language file and so on, then the GENERATOR compiles both "au3" sources for the SUPPORT and VIEWER.
I'm using the ResourceEx UDF from Guiness and MetroUI UDF from BBs19. I even made some changes to the MEtroUI, that I shared here.
This project will be uploaded to my Github account as soon I get this GENERATOR working, so people can actually use it.
As explained, I need to compile the AU3 source files and perform an Resource Update. SciTE does that for me, right, but I just find sloppy making the GENERATOR open the script on the installed SciTE, clicking in the menus, waiting the process to end and then exit.
When I hit the Compile or Build on SciTE, it generates this output:
I've tried emulating this using the promt with console commands:
It returns an error saying it was not possible to perform a resource update, poiting an TMP file on the ".../AppData/Local/AutoIt3/".
As I understand, it runs the AutoIt3Wrapper, then the Wrapper should call the Aut2Exe to compile the script and then the Wrapper incorporate the resources into the compiled Script. It generates the file into a TMP one then copies to the directory defined in the Wrapper Directive.
I know this seems strange, that you think I might be trying to pack AutoIt into my project with no F*** given, no... I just want to automate the compilation process, if there's no solution using console commands, I'll need to automate the process sending keyboard and mouse commands, what will be ugly and problematic.
So... any help is a heaven's gift at this point.