Jump to content
JScript

CreateFilesEmbedded.au3 - Like FileInstall...

Recommended Posts

JScript

CreateFilesEmbedded.exe

Application to embed files into their programs in the format .AU3


I present a different format to add files in your script:

So how about having our files (photos, text, executables) built?

1 - We can use the binary variables with

2 - We can test the fully functional program with F5 SciTE

4 - Use your imagination!!!

Sintax / Examples:

#include "YourFileEmbedded.au3"

; Returning the code in binary format
$bData = _YourFileEmbedded()

; Saving the code in the HDD
_YourFileEmbedded( True, @ScriptDir)

; Saving and running the code
_YourFileEmbedded( True, @ScriptDir, True)

; Finally, running the code directly
Run(_YourFileEmbedded(True))

Language file sample:

; #INDEX# =======================================================================================================================
; Title .........: CreateFilesEmbedded™
; Module ........: Language
; Author ........: Reaper HGN
; Link ..........: http://www.autoitscript.com/forum/topic/132564-createfilesembeddedau3-like-fileinstall/#entry930932
; Language ......: English (United States)
; ===============================================================================================================================

[0409]
1 = Options for the output file.
2 = Create a function based on the output name.
3 = Adding patterns of User Defined Functions (UDF).
4 = Only create the output file with the binary.
5 = Adding native LZNT Windows compression.
6 = Compression level
7 = &Open File
8 = Embedding file
9 = Test
10 = Default
11 = Progress of conversion:
12 = Exit
13 = Converted Lines
14 = Choose a file to embed
15 = The file
16 = no exist!
17 = 'The test only with the option: "Create a function based on the output name" activated!'
18 = Wait, creating the file. AU3 ->
19 = Save the file as built
20 = Compressing the file, wait...
21 = Done!
22 = The file
23 = was embedded in the format .AU3!

Supports:

; All file types!

Downloads:

Version: 2.27

CreateFilesEmbedded_(RedirectLink).html

(Previous downloads: 575)

Example using the binary return (without writing the file in HDD)

BinarySoundTest.zip

Sample:

Posted Image

Fixes:

  • 2.27.0912.2600
  • 27/09/2012 -> Some bugs fixed and added multi-language support!
  • 1.15.0911.2600b
  • 02/09/2011 -> First release!


Free Software

Redistribute and change under these terms:

1 - This program is free software: you can redistribute it and / or modify it under the terms of the GNU General Public License

As published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

2 - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty

of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

3 - You should have received a copy of the GNU General Public License along with this program.

If not, see http://www.gnu.org/licenses.

João Carlos.

Edited by Melba23
File removed at JScript's request

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites
Skitty

Well, Portuguese is a lot like my native language, I was surprised when I actually understood everything in that language, I didn't know it was so similar to Spanish.

CreateFilesEmbedded.au3

Edited by THAT1ANONYMOUSEDUDE

Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites
twitchyliquid64

@THAT1ANONYMOUSEDUDE

Muchas gracias!

¡Tienes razón! És muy parecida...

Thank you very much!

You're right! Is very similar

João Carlos.

muchas? zomg i love muchas! corn chips, salsa, melted cheese, tomato...what more could you want in a food?


ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Share this post


Link to post
Share on other sites
SandelPerieanu

i tested with the same file

With FileInstall - 3.87 Mb

With CreateFilesEmbedded.au3 - 6.70 Mb (- LZNT level 2)

for me it's not ok.

thanks.

Share this post


Link to post
Share on other sites
JScript

@SandelPerieanu

Very strange, see this example:

Download: Test_(Embedded&FileInstall).zip

Test_(Embedded).au3

#AutoIt3Wrapper_Compression=4           ;Compression parameter 0-4  0=Low 2=normal 4=High. Default=2
#AutoIt3Wrapper_UseUpx=y                ;(Y/N) Compress output program.  Default=Y
 
#include "Zune.au3" ; 970KB, LZNT level 2
 
_Zune(True, @TempDir)
Test_(Embedded).exe = 978KB

Test_(FileInstall).au3

#AutoIt3Wrapper_Compression=4           ;Compression parameter 0-4  0=Low 2=normal 4=High. Default=2
#AutoIt3Wrapper_UseUpx=y                ;(Y/N) Compress output program.  Default=Y
 
FileInstall(".Zune.msstyles", @TempDir) ; 12.028KB
Test_(FileInstall).exe = 1.736KB

Conclusion: Who is smaller?

João Carlos.

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites
JFX

Conclusion: Who is smaller?

it depends on how "compress able" a file is.

AutoIt uses a very week compression for script and fileinstall, but it stores it better.

Your function compresses much better, but stores not efficient (Hex values not binary)

Anyway thank you very much for this script. :graduated:

Share this post


Link to post
Share on other sites
JScript

@JFX

You're right! I'll see what I can do to improve it...

Do you have any idea? I was thinking of store in resource...

João Calos.

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites
JFX

hmm, store in resource would be a very good solution for complied scripts.

for not complied it could be Base64 encoded, like in some other script (ex. AutoitObject)

Share this post


Link to post
Share on other sites
trancexx

hmm, store in resource would be a very good solution for complied scripts.

for not complied it could be Base64 encoded, like in some other script (ex. AutoitObject)

Excellent observation.

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
JFX

@jscript

Yes Base64 is a better choice then Hex format. It just need 4 Bytes to save 3 Bytes binary data

See here or

@trancexx

Thanks. It's a pleasure to read such excellent scripts

Share this post


Link to post
Share on other sites
Reaper HGN

I wanted to try this out, but wasnt sure about what the options and text was saying. I saw that you needed some translation, so I played around with the translate in Google. I copied your text into a language file and created a select based on your OSLang return value. I only did the original Portuguese and the additional English (You may want to do it a different way). Anyway, I modified the original file slightly to use all the variables that are setup in the language file.

Now I can check it out and see if it work for me :graduated:

Attaching files

CreateFilesEmbedded.au3

language.au3

Edited by Reaper HGN

Share this post


Link to post
Share on other sites
RugWarrior

Great UDF!

Can't wait for the new version :D

Share this post


Link to post
Share on other sites
RugWarrior

Hi, I played around with the translation file as you will not get something on the screen to read if your system has another language set (like german).

Hopefully I will have same spare time during the next couple of days I will translate it to german also.

Greetings RW

#include ".\Include\_GetOSLangString.au3"

$SysLang = _GetOSLangString(@OSLang)
Global $a_language[24]

If StringInStr($SysLang, "Portuguese", False) Then

  $a_language[1] = "Opções do arquivo de saída."
  $a_language[2] = "Criar uma função baseada no nome de saída."
  $a_language[3] = "Adicionar padrões de Funções Definidas pelo Usuário (UDF)."
  $a_language[4] = "Apenas criar o arquivo de saída com o binário."
  $a_language[5] = "Adicionar compressão  LZNT nativa do Windows."
  $a_language[6] = "Nível de compressão:"
  $a_language[7] = "&Abrir arquivo"
  $a_language[8] = "Embutir arquivo"
  $a_language[9] = "Testar"
  $a_language[10] = "Padrão"
  $a_language[11] = "Progresso de conversão:"
  $a_language[12] = "Sair"
  $a_language[13] = "Linhas convertidas:"
  $a_language[14] = "Escolha um arquivo para embutir:"
  $a_language[15] = "O arquivo "
  $a_language[16] = " não existe!"
  $a_language[17] = 'O teste somente com a opção: "Criar uma função baseada no nome de saída" ativada!'
  $a_language[18] = "Aguarde, criando o arquivo .AU3 -> "
  $a_language[19] = "Salvar o arquivo embutido como"
  $a_language[20] = "Compactando o arquivo, aguarde..."
  $a_language[21] = " - Concluído!"
  $a_language[22] = 'O arquivo "'
  $a_language[23] = '" foi embutido para au3.'

Else ;"English"

  $a_language[1] = "Options for the output file."
  $a_language[2] = "Create a function based on the output name."
  $a_language[3] = "Adding patterns of User Defined Functions (UDF)."
  $a_language[4] = "Only create the output file with the binary."
  $a_language[5] = "Adding compression LZNT native Windows."
  $a_language[6] = "Compression level"
  $a_language[7] = "&Open File"
  $a_language[8] = "Embedding file"
  $a_language[9] = "Test"
  $a_language[10] = "Standard"
  $a_language[11] = "Progress of conversion:"
  $a_language[12] = "Exit"
  $a_language[13] = "Converted Lines"
  $a_language[14] = "Choose a file to embed"
  $a_language[15] = "File"
  $a_language[16] = "No!"
  $a_language[17] = 'The test only with the option: "Create a function based on the output name" activated!'
  $a_language[18] = "Wait, creating the file. AU3 equipment ->"
  $a_language[19] = "Save the file as built"
  $a_language[20] = "Compressing the file, wait ..."
  $a_language[21] = "- Done!"
  $a_language[22] = 'File" '
  $a_language[23] = '"AU3 equipment was built for."'

EndIf

Share this post


Link to post
Share on other sites
Belini

Tested and approved, much better than FileInstall () thanks for sharing.

Edited by Belini

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

  • Similar Content

    • Blueman
      By Blueman
      Hey Guys,
      Hope that you can help me with something, maybe this is a bug in the new version of AUTOIT but first i will check it with you to know for sure.
      I have made a simple GUI with a Embedded IE Object, then i would like to read the HTML with _IEBodyReadHTML(), easy right?
      When i use the old IE.au3 include from a year back or so, it is working fine!
      When i use the new IE.au3 include came with the new installation that is currently available on autoitscript.com it isnt working (i get a result that says; 0).
      Let me show you.
       
      Working Example
      #include <GUIConstantsEx.au3> #include <IE_EmbeddedVersioning.au3> #include <IE_PreVersion.au3> ;Older Version Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 1000, 1000) Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) Global $oIE_1 = _IECreateEmbedded() ; CREATE IE OBJECT(S) GUICtrlCreateObj($oIE_1, 355, 5, 600, 360) _IENavigate($oIE_1, "https://www.google.nl", 1) Local $CheckHTML_T = _IEBodyReadHTML($oIE_1) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox(48,"",$CheckHTML_T) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example  
      Failing Example
      #include <GUIConstantsEx.au3> #include <IE_EmbeddedVersioning.au3> #include <IE.au3> ;New Version Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 1000, 1000) Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) Global $oIE_1 = _IECreateEmbedded() ; CREATE IE OBJECT(S) GUICtrlCreateObj($oIE_1, 355, 5, 600, 360) _IENavigate($oIE_1, "https://www.google.nl", 1) Local $CheckHTML_T = _IEBodyReadHTML($oIE_1) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox(48,"",$CheckHTML_T) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example  
      I have attachted all files and i am testing on Windows 10 with the latest SciTe Program (Not compiled). 
      When i compile the script it is showing the same result.
      Thanks guys!
      IE_PreVersion.au3
      IE.au3
      IE_EmbeddedVersioning.au3
    • NHD
      By NHD
      Sorry, I'm not good English 

      Hi,
      I'm developing CefAu3 project, it embed Chromium browser to your AutoIt program.
      I'm busy and can stop it. If you want to contribute, you can fork my project and build it yourself.




      Some Features:
      - Easy create CEF window
      - Multi-message loop
      - Interaction between AutoIt and JavaScript
      - Supports AutoIt binding
      - Supports user events...

      Github: https://github.com/wy3/cefau3
      Wiki: https://github.com/wy3/cefau3/wiki
      CEF + UDF: https://github.com/wy3/cefau3/releases/download/releases/Cefau3.zip
      Source code: https://github.com/wy3/cefau3/archive/master.zip
       
      CEF project: https://bitbucket.org/chromiumembedded/cef
      Learn more: http://magpcss.org/ceforum/

      [Processing in CEF: 30%]
    • Barrtrek
      By Barrtrek
      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.
    • Ascer
      By Ascer
      Hello.
      A couple week ago i've started learning API Interface for different websites. In this fact sometimes you have to encode your "photo" or "document.body" to send request.
      Functions to encode and decode Base64 was already created by others. Unfortunately i have troubles with running it on Windows R 2008, also speed was terrible.
      I try to find alternative way to code data. 
      I've read about Microsoft "XMLDOM" and created a one simple function to Encode / Decode data to base64binary, base64url
      Thanks for Ghads on Wordpress i coverted a part of his lines from VBscript to AutoIT
      ;============================================================================================================================== ; Function: base64($vCode [, $bEncode = True [, $bUrl = False]]) ; ; Description: Decode or Encode $vData using Microsoft.XMLDOM to Base64Binary or Base64Url. ; IMPORTANT! Encoded base64url is without @LF after 72 lines. Some websites may require this. ; ; Parameter(s): $vData - string or integer | Data to encode or decode. ; $bEncode - boolean | True - encode, False - decode. ; $bUrl - boolean | True - output is will decoded or encoded using base64url shema. ; ; Return Value(s): On Success - Returns output data ; On Failure - Returns 1 - Failed to create object. ; ; Author (s): (Ghads on Wordpress.com), Ascer ;=============================================================================================================================== Func base64($vCode, $bEncode = True, $bUrl = False) Local $oDM = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oDM) Then Return SetError(1, 0, 1) Local $oEL = $oDM.createElement("Tmp") $oEL.DataType = "bin.base64" If $bEncode then $oEL.NodeTypedValue = Binary($vCode) If Not $bUrl Then Return $oEL.Text Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"),"/", "_"), @LF, "") Else If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/") $oEL.Text = $vCode Return $oEL.NodeTypedValue EndIf EndFunc ;==>base64  
       
    • wakillon
      By wakillon
      BinaryToAu3Kompressor v1.0.5.4
       

       
      It's now possible to see the best compression ratio using LZMA, LZNT and Base64 compressions with differents combinations.
      Nothing too complicate, you drag'n drop a file on the picture and script Test all compression types and return the ratios.
      ( Test duration depends of file size, slowest compression is LZNT, but all decompressions are fast  )
      Free to you after, to choose the compression(s) you want...
      Yes, LZMA needs a dll ( embedded & compressed in script ) but brings a powerfull compression. 
      It opens scite with your file compressed to an au3 script with or without decompression function as you want.
      Hold Left Shift key when clicking button for just copy script to clipboard.
      Use the 3 compressions at a time works but doesn't give a good ratio, that's why i don't display it.
      Usefull for little files you want include in your scripts !
      No externals files needed, they are already in script.
      Previous downloads : 1103
      Source and Executable
      BinaryToAu3Kompressor will be added to the next version of >SciTEHopper
      Thanks to Ward for his >Base64.au3 and LZMA.au3, and trancexx for his >LZNT functions and his >Base64Decode function.
×