Karnalsyn

File inclusion functionality

4 posts in this topic

#1 ·  Posted

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

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

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.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted

Thanks for clarification. I had read the help file but wasn't comprehending it fully.

Share this post


Link to post
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