Jump to content

File inclusion functionality


Recommended Posts

I have a generic question regarding the 'FileInstall' feature for AutoIT.

Now my question likely answers itself when I fully comprehend the feature, but as I understand it. FileInstall will include all desired files into the compiled .EXE and then auto extract them to the designated location upon execution of the .EXE correct?

Assuming that I comprehend it correctly. My question becomes, Can I utilize the script without the immediate extraction of those files? Or is that an inevitable outcome of running the script? I'm looking to leverage areas of an already existing overly complicated script that don't need file extraction to occur in their respective functions.

The example in question would be this...

I am presently updating an automated installation package. Script utilized the FileInstall to include roughly 350mb worth of vendor files.

Script has multiple functions, including Install, uninstall, file caching to location (prep for install at later date), etc.

Now if I'm understanding the way FileInstall works, no matter if I build in a switch to target the uninstall function via command line entry detection, etc....those FileInstall files will still extract to the system first no matter what?

It's been a long day and I'm about to pack it in here at work. There is a chance I'm not even making sense lol. If that's the case, I'll try and elaborate more.

Thanks

 

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

As I understand the helpfile extraction is optional: "These included files can then be "extracted" during execution of the compiled script if the statement is executed."
The example in the help file shows how to use a flag to decide if extraction is needed or not.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Welcome @Karnalsyn!

As Water said and as explained in the help file:

https://www.autoitscript.com/autoit3/docs/functions/FileInstall.htm

Quote

These included files can then be "extracted" during execution of the compiled script if the statement is executed.

This means that when you compile your script, each file located in the first argument of the function will be added inside the compiled exe file.

But the file will be extracted to the second argument path of the fonction ONLY when the program reach the "Fileinstall" line.

For example:

$answer = InputBox("Install the file?", "1 = YES" & @CRLF & @CRLF & "2 = NO")

if $answer = 1 Then

    Fileinstall("c:\path_of_file_to_add.txt","C:\path_of_file_to_install_to\file.txt")
    
EndIf

When you compile this program, the file "c:\path_of_file_to_add.txt" will be added inside the compiled exe.

When you  run this compiled exe, it will NOT directly install the file. It will only do it if you answer 1 to the prompt :)

Edited by Neutro
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...