SonJoe Posted January 30, 2022 Share Posted January 30, 2022 Hi all, I have compiled a script to exe (using aut2exe) and delivered it to another machine, which does not have AutoIt installed. There, it does not run, but tells me that an undefined variable is used. I assume that the files referred to by #include are not embedded in the exe. How can I make sure the included files are available, when I deploy the exe to another machine? Thanks in advance for your helpful hints! Link to comment Share on other sites More sharing options...
Developers Jos Posted January 30, 2022 Developers Share Posted January 30, 2022 Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
argumentum Posted January 30, 2022 Share Posted January 30, 2022 1 minute ago, SonJoe said: I have compiled a script to exe ..once compiled, is all included. Check your code. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 30, 2022 Developers Share Posted January 30, 2022 Everything will be included that is defined in your main script, so there must be somewhere a logic issue. Show you script and the error you get so we can help checking it. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted January 30, 2022 Share Posted January 30, 2022 3 minutes ago, SonJoe said: I assume that the files referred to by #include are not embedded in the exe. You would be incorrect. There's at least one bug in your script that needs correcting. 😉 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
SonJoe Posted January 31, 2022 Author Share Posted January 31, 2022 On the developer machine, it runs smoothly. That's why I guess the reason might be something missing in the compiled file, that is automatically found on the developer machine. Here's the script. zoom-shot-man.au3 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 31, 2022 Moderators Share Posted January 31, 2022 Sonjoe, Running Au3Check on your script produced the following error and warnings (plus another 38 warnings about declaring Global variables within a function): >Running AU3Check (3.3.15.5) params:-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w- 7 from:M:\Program\AutoIt3 input:M:\Downloads\zoom-shot-man.au3 "M:\Downloads\zoom-shot-man.au3"(221,65) : warning: $PageDelayDelay: possibly used before declaration. RegWrite ($RegKey, $RegValPageDelay, "REG_SZ", $PageDelayDelay) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "M:\Downloads\zoom-shot-man.au3"(390,49) : error: syntax error GUICtrlSetState ($AutoResetCheckbox, $AutoReset: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "M:\Downloads\zoom-shot-man.au3"(480,40) : warning: $PicViewerPID possibly not declared/created yet $PicViewerPID = Run ($PicViewerProg1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "M:\Downloads\zoom-shot-man.au3"(519,33) : warning: $FileNameFix: possibly used before declaration. Local $FileName = $FileNameFix & ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "M:\Downloads\zoom-shot-man.au3"(221,65) : error: $PageDelayDelay: undeclared global variable. RegWrite ($RegKey, $RegValPageDelay, "REG_SZ", $PageDelayDelay) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ M:\Downloads\zoom-shot-man.au3 - 2 error(s), 41 warning(s) !>10:43:25 AU3Check ended. Press F4 to jump to next error.rc:2 +>10:43:25 AutoIt3Wrapper Finished. >Exit code: 0 Time: 3.652 M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2022 Developers Share Posted January 31, 2022 ... and on top of that you didn't tell us the error you are getting.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SonJoe Posted February 1, 2022 Author Share Posted February 1, 2022 Thanks a lot! Au3Check is actually new to me. And I did not now that it's forbidden to define global variables in a function. I thought that, after it worked well on the developer machine, it would be ok. And it looks like this explains why the error message was "Variable used without being declared.". Nevertheless, I'm surprised that it works on the developer machine, if it's not allowed. Link to comment Share on other sites More sharing options...
jchd Posted February 1, 2022 Share Posted February 1, 2022 It isn't forbidden, just bad practice since it's prone to the kind of error you've experienced. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Nine Posted February 1, 2022 Share Posted February 1, 2022 Also when it gets time to debug a script after a few months (or someone else may try to modify the code), it is quite a nightmare to follow global variables declare everywhere in the code. The best practice is to declare ALL global variables at the very beginning of the code. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now