Sign in to follow this  
Followers 0
unclefishy

Embedding A "source File" Into An Exe?

18 posts in this topic

SO...

I am trying to figure out if there is any way to embed the source file into the exe, so I wouldn't need to both files in order to run smoothly...

like take the winzip tutorial for example... in order for the script to work you also need to have the winzip file located... somewhere. I want to know it I can embed this file into the script's exe so there is only one file to manage. so I can just run the exe from where-ever and it will install flawlessly. with out haveing to also copy over the actual winzip application,

and if so... what would be the path that I would use for the Run command.

or am I better off just dumping the programs that we install for a roll-out on a network share drive somewhere and hardcoding the path into the exe

Thanks in advance... this program will change my life... as soon as I master it :)

Uncelfishy

Share this post


Link to post
Share on other sites



fileinstall()

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

DOH!!!

see i knew it was an easy one :)

thanks "Valuater"

Share this post


Link to post
Share on other sites

does it matter where this command is located in the script?

i.e. before or after the "run" command?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

$Program_1 = @TempDir & "\Temp1.exe"
FileInstall("C:\Program Files\AutoIt3\beta\Au3Info.exe", $Program_1)

Run($Program_1)

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Hmm, I'm trying to use this to install a .gif image in my script so that I don't have to have the .gif image separate from the .exe for when I give this program to someone else, but it doesn't seem to be working. If I move the .gif image to a different folder after I compile the script, it doesn't appear when I run the program, but it does if I leave it in the folder.

How would I include the .gif without having to send the .gif with the .exe?


Share this post


Link to post
Share on other sites

as you stated it... it should work.... it does for me

please post code so we can verify proper useage

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hmm, I'm trying to use this to install a .gif image in my script so that I don't have to have the .gif image separate from the .exe for when I give this program to someone else, but it doesn't seem to be working. If I move the .gif image to a different folder after I compile the script, it doesn't appear when I run the program, but it does if I leave it in the folder.

How would I include the .gif without having to send the .gif with the .exe?

Post your code so that we can advise what you are doing wrong.

Edit - Shit I never know when these anon users are posting.

Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

fileinstall("C:\WINDOWS\Desktop\GUI\Nomad.gif", "C:\WINDOWS\Desktop\GUI\GUIPIX2.au3")

I've also tried this:

fileinstall("C:\WINDOWS\Desktop\GUI\Nomad.gif", "C:\WINDOWS\Desktop\GUI\GUIPIX2.exe")


Share this post


Link to post
Share on other sites

fileinstall("C:\WINDOWS\Desktop\GUI\Nomad.gif", "C:\WINDOWS\Desktop\GUI\GUIPIX2.au3")

I've also tried this:

fileinstall("C:\WINDOWS\Desktop\GUI\Nomad.gif", "C:\WINDOWS\Desktop\GUI\GUIPIX2.exe")

You have to specify where you want to place the gif file. What you are doing is giving it a completely different name. I would guess that in your script you are calling it from "C:\WINDOWS\Desktop\GUI\Nomad.gif" when you are using it. You should call it up from where you install it to not the original source.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

You have to specify where you want to place the gif file. What you are doing is giving it a completely different name. I would guess that in your script you are calling it from "C:\WINDOWS\Desktop\GUI\Nomad.gif" when you are using it. You should call it up from where you install it to not the original source.

Ok, I think I get what you are saying, I'm going to try a couple things and get back to you. Thanks.


Share this post


Link to post
Share on other sites

its a gif.... save it as a gif

fileinstall("C:\WINDOWS\Desktop\GUI\Nomad.gif", "C:\WINDOWS\Desktop\GUI\GUIPIX2.au3")

I've also tried this:

fileinstall("C:\WINDOWS\Desktop\GUI\Nomad.gif", "C:\WINDOWS\Desktop\GUI\GUIPIX2.exe")

not au3 or exe

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

FileInstall uses two parameters:

FileInstall(Parameter 1, Parameter 2)

Parameter 1 is where to find it. Parameter 2 is where to unpack it to when the FileInstall command is reached.

When compiling your source, the source file (in your case the .gif) is packaged up into it, and you use fileinstall to bring it back out.


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites

FileInstall uses two parameters:

FileInstall(Parameter 1, Parameter 2)

Parameter 1 is where to find it. Parameter 2 is where to unpack it to when the FileInstall command is reached.

When compiling your source, the source file (in your case the .gif) is packaged up into it, and you use fileinstall to bring it back out.

Yeah, I figured that out, finally, LOL. I did this since the @TempDir didn't work for me for some reason:

$GIF1 = @ScriptDir & "\Nomad.gif"

fileinstall("C:\WINDOWS\Desktop\Nomad.gif", $GIF1)

I hid the .gif just to see if it would still show in the program, and it did. I also checked to see if the .gif was installed to the script directory, and it was.. even though I hid the source file, so it is in the .exe.

I guess you have no choice but to install the .gif somewhere on the computer to be able to run it?


Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I guess you have no choice but to install the .gif somewhere on the computer to be able to run it?

true, however the @tempdir is located at

drive \ doc & settings \ user \ local settings \ temp \

most people dont look there

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Ok, I also figured out why the @TempDir wasn't working. I forgot to change the script and tell it to look in the @TempDir to find the .gif when calling the .gif to display it... duh.

Thanks for the help, this will really help me out with this script since I have a few other images and .wav files I would like to do this to as well.


Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

welcome

kinda like me

; Installs  
$Program_1 = @TempDir & "\Temp1.exe"
FileInstall("C:\Program Files\AutoIt3\beta\Au3Info.exe", $Program_1)
$Program_3 = "";@TempDir & "\Temp3.exe"
;FileInstall("C:\Program Files\AutoIt3\beta\AutoIt3.exe", $Program_3)
$Sound_lnk = @TempDir & "\Sound_lnk.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Notify.wav", $Sound_lnk)
$Sound_clk = @TempDir & "\Sound_clk.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Clickerx.wav", $Sound_clk)
$Sound_grp = @TempDir & "\Sound_grp.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Group_open.wav", $Sound_grp)
$Sound_bar = @TempDir & "\Sound_msg.wav"
FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\message.wav", $Sound_bar)
$My_pic = @TempDir & "\XPClean.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\XPClean.jpg", $My_pic)
$Icon_pic = @TempDir & "\Icon.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\icon-scrn.jpg", $Icon_pic)
$Sample_pic = @TempDir & "\Sample.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\Sample-GUI.jpg", $Sample_pic)
$Logo_jpg = @TempDir & "\Logo-au3.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\au3-logo.jpg", $Logo_jpg)
$Builder_pic = @TempDir & "\GUI-Lnch.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\GUIBuilder.jpg", $Builder_pic)
$Wall_pic = @TempDir & "\Wall-pic.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\AutoIt-wall.jpg", $Wall_pic)
$Notepad_pic = @TempDir & "\Notepd-pic.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\Notepad.jpg", $Notepad_pic)
$AU3Info_pic = @TempDir & "\AU3Info-pic.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\AU3Info.jpg", $AU3Info_pic)
$Ball_pic = @TempDir & "\Ball-pic.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\Curveball.jpg", $Ball_pic)

SplashImageOn("", $Logo_jpg, 400, 300, -1, -1, 1)
SoundPlay($Sound_lnk, 1)

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

thank you all very much... I got it!!!

Whoo-HOO!!!

:)

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