Recently Browsing 0 members
No registered users viewing this page.
What i'm trying to achieve is to bundle a few folders within the executable script and from what I've read it can be done with:
#include <FileConstants.au3> FileInstall(src, dest, $FC_OVERWRITE) I know that src must be a literal string and cant be a variable or macro. However, I also learned that I cant just install a folder but there is a workaround that uses 7zip or winrar so that FileInstall extracts the folder to the desired location (e.g. to dest) so I wend and tried both variants:
I zipped a single folder just for testing. I winrared a single folder just for testing. Keep in mind that both the .zip and .rar are the same folder with the same content.
The problem I ran into is that FileInstall simply moves the .rar or .zip folder to the desired location but it doesn't extract it!
#RequreAdmin #include <FileConstants.au3> Func installESPLibraries() Local Const $sLibrariesPath = @LocalAppDataDir & "\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries" FileInstall("esp-libraries\ESP32-ADXL345.rar", $sLibrariesPath & "\", $FC_OVERWRITE) EndFunc installESPLibraries() The result I'm left with is that ESP32-ADXL345.rar just gets moved to $sLibrariesPath (so it does kinda work). The result I want is to have ESP32-ADXL345.rar extracted to the same location so that I have only a folder with the name ESP32-ADXL345 without any winrar files. Is there a way to achieve such a thing ? (because i'm sure there is).
NOTE: I already did search the forum for such a solution:
how to use fileinstall want to bundle my exe foldersfiles embedding images folders in exe However, They all show practical examples with files and none with folders (the third link mentions folders but has no examples) so I am at a loss as to how it should be done.
Thanks to @Musashi and @Nine for pointing out what I was missing! Also, I would like to add my solution:
#RequreAdmin #include <FileConstants.au3> ; Create a local constant string to hold a path to the folder where we will be installing the libraries Local Const $sLibrariesPath = @LocalAppDataDir & "\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\" ; Unpack libraries.rar to the path we defined FileInstall("libraries.rar", $sLibrariesPath, $FC_OVERWRITE) ; Run the batch script to extract libraries.rar at the path we defined RunWait("unrar.bat " & $sLibrariesPath & " libraries.rar", "", @SW_HIDE) ; Deletes libraries.rar FileDelete($sLibrariesPath & "libraries.rar") I attached the .bat file I wrote to make it work. The reasoning for this solution is to show how its done cleanly with .rar files as I didn't see anyone do it this way. Hope it helps people in the future!
I have a source Script where I inserted the following code lines to be able to extract the script source code anytime later if I run it with the /ExtractSourceCode:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
If StringInStr($cmdlineRaw, "/ExtractSourceCode") Then
FileInstall(@ScriptFullPath, @ScriptDir & "\" & @ScriptName & ".txt", 1)
;FileInstall("C:\Test.txt", @ScriptDir & "\Test.txt")
I used to be able to compile it on another computer some years ago without problems.
Now I wanted to modify the code, so I extracted it, renamed the file *.au3, performd my little modification and rebuild.
Strangely, I get this popup with Caption: Aut2Exe Error and Invalid FileInstall() function.
BEfore I hit the OK button on the Popup, I can see the file is actually Built as I can see that an EXE file is created, but as I hit OK in that error dialog, the EXE disappears.
I can't remember if I did it with Autoit 2
I've been very fond of portable software. Some of the portable programs are quite large, so to make the using fancier, I started to compress the portable applications into a WinRar SFX Archive which extracts the software to the tempdir, starts the software and afterward deletes the whole temp Dir.
But it got cumbersome to manually extract the icon from the exe, make all necessary settings in the WinRar GUI - so I wrote this script. Nothing spectacular, but (in my eyes) very useful. After that, I added some other options to make it a little more versatile.
if we have a 32Bit and a 64Bit version, it can launch the correct Version (32Bit or 64Bit) fitting to the system the SFX is started on (contains a small exe file "universal_launcher.exe" which expects two parameters for the 32Bit.exe and 64Bit.exe, checks the current system for 64Bit and then runs the correct file). Powerbasic Sourcecode of the exe file is included, of course. automatically extracts the icon from the chosen exe and uses it as icon for the SFX if the chosen exe file has a version number in it, the version is put in the resulting SFX's filename can just extract the files to a user-chosen directory OR can just extract the files to the program files directory (and, optionally, create a desktop shortcut) OR extract the files to a temp directory and run an exe Have fun with it
I get the "Unable to add resources" error related to AppData\Local\AutoIt v3\Aut2Exe when compiling with a large FileInstall of a 1.5GB file. Is there a size limit I need to be aware of? I've also disabled or removed Trend from three different machines and had the same results. I've had issues like this in the past but have compiled after the Aut2Exe folder was excluded in AV. That doesn't seem to be the problem this time around. If I comment out the FileInstall the script compiles successfully.
Profiler - yet another backup script for Firefox and Thunderbird profiles
It automatically detects the last recently used profile directories of Firefox and Thunderbird (installed versions, no portables).
Clicking the Backup-Button creates a complete Backup of the found profiles with a timestamp.
Restore deletes the according profile dir and extracts the content of the selected archive into the profile directory.
Uses Winrar as compression tool, but feel free to change it to your needs