Sign in to follow this  
Followers 0

CreateFilesEmbedded.au3 - Like FileInstall...


49 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

#3 ·  Posted

@THAT1ANONYMOUSEDUDE

Muchas gracias!

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

Thank you very much!

You're right! Is very similar

João Carlos.


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

#4 ·  Posted

@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

#5 ·  Posted

@twitchyliquid64

Funny, but the topic is about scripts, not food! :graduated:

João Carlos.


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

#6 ·  Posted

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

#7 ·  Posted (edited)

@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

#8 ·  Posted

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

#9 ·  Posted (edited)

@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

#10 ·  Posted

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

#11 ·  Posted (edited)

Base64 encoded?!?! It's better than in Hex format?

Could you give me an example?

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

#12 ·  Posted

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

#13 ·  Posted

@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

#14 ·  Posted

@JFX,

OK, you have convinced me, updated code!

João Carlos.


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

#15 ·  Posted (edited)

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

#16 ·  Posted

@Reaper HGN

Many thanks guy! I'm doing a new version, then I'll include multilanguage support...

João Carlos.


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

#17 ·  Posted

Great UDF!

Can't wait for the new version :D

Share this post


Link to post
Share on other sites

#18 ·  Posted

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

#19 ·  Posted (edited)

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

Edited by Belini

Share this post


Link to post
Share on other sites

#20 ·  Posted

Hi @Belini

I'm doing a few more changes and then post here and in the Brazilian forum, thank you very much!

Regards,

João Carlos.


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

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
Sign in to follow this  
Followers 0