Eine spezielle Anweisung zur Steuerung bestimmter Aspekte der Kompilierung des Skripts.
#pragma pragma-option
| pragma-option | compile |
Siehe pragma directives für mehre Details.
#pragma compile(Out, myProg.exe)
; Entfernt das Kommentarzeichen, um das folgende Symbol zu verwenden. Stellt sicher, dass der Dateipfad korrekt ist und mit dem Installationspfad von AutoIt übereinstimmt.
; #pragma compile(Icon, C:\Program Files\AutoIt3\Icons\au3.ico)
#pragma compile(ExecLevel, highestavailable)
#pragma compile(Compatibility, win7)
#pragma compile(UPX, False)
#pragma compile(FileDescription, myProg - eine Beschreibung der Anwendung)
#pragma compile(ProductName, myProg)
#pragma compile(ProductVersion, 3.7)
#pragma compile(FileVersion, 3.7.0.0, 3.7.100.201) ; Der letzte Parameter ist optional.
#pragma compile(LegalCopyright, © Joe Bloggs)
#pragma compile(LegalTrademarks, '"Markenzeichen für etwas und Text in „Anführungszeichen“ usw...')
#pragma compile(CompanyName, 'Joe Bloggs & Co')
#include <MsgBoxConstants.au3>
If @Compiled Then
Example()
Else
MsgBox($MB_SYSTEMMODAL, "", "Bitte kompiliere das Programm, bevor es ausgeführt wird.")
EndIf
Func Example()
; Ermittelt die Dateiversion der AutoIt-Ausführungsdatei.
Local $sFileVersion = FileGetVersion(@AutoItExe)
; Zeigt die Dateiversion an. Dies sollte mit @AutoItVersion übereinstimmen.
MsgBox($MB_SYSTEMMODAL, "", $sFileVersion)
EndFunc ;==>Example
; es ist cie Option Out zum Kompilieren in eine A3x-Datei zu verwenden
#pragma compile(Out, pragma[2].a3x)
#include <MsgBoxConstants.au3>
MsgBox($MB_ICONINFORMATION, @ScriptName, 'Kompiliert ? ... ' & @Compiled)
#pragma compile(Out, pragma[3].exe)
; Verwende die Option „AutoItExecuteAllowed“, um die Ausführung von au3- oder a3x-Dateien zu ermöglichen, wobei diese kompilierte EXE-Datei als Interpreter dient.
#pragma compile(AutoItExecuteAllowed, true)
#HINWEIS: Bevor man dieses Beispiel verwendt, muss man zunächst die Datei „pragma[2].au3“ kompilieren.
#include <MsgBoxConstants.au3>
_Example()
Func _Example()
Local $iPID_au3 = Run(@ScriptFullPath & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\pragma[2].au3"')
While ProcessExists($iPID_au3)
Sleep(10)
WEnd
MsgBox($MB_ICONINFORMATION, 'Prüfung 1', 'Nach dem Start von running pragma[2].au3')
Local $iPID_a3x = Run(@ScriptFullPath & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\pragma[2].a3x"')
While ProcessExists($iPID_a3x)
Sleep(10)
WEnd
MsgBox($MB_ICONINFORMATION, 'Prüfung 2', 'Nach dem Start von pragma[2].a3x')
EndFunc ;==>_Example