Sign in to follow this  
Followers 0
Paradox

How can I compile additional files?

9 posts in this topic

Is there a way that I can add additional files to my executable to reduce the amount of other files for my installs?? Basically, I have 7 files that I want to add into my one main installer files so that a user cannot access the other additional files directly. I've been readin the documentation on the FileInstall() function, but I'm slightly confused by the example that it gives...

FileInstall("C:\test.au3", "D:\mydir\test.au3")

Is this meaning that the script is going to include the file "test.au3" and when the executable is run, it's going to extract it to "d:\mydir\test.au3"??? What I'm trying to do is include the following self-created files into one main executable that I've called "Startup.exe":

Client ODBC Setup.exe

deleteme.bat

dotnetfx.exe

makelot.exe

MSDEinstall.exe

Web Data Administrator.exe

Server.exe

When/if I use this FileInstall function in my Startup.au3 script, is it just going to add them to the Startup.exe??? And moreover, this application is going to be burned to a cd for distribution... would that change the source location or anything???

-Extremely confused.... ;)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Is this meaning that the script is going to include the file "test.au3" and when the executable is run, it's going to extract it to "d:\mydir\test.au3"???

That is exactly what it does. When the EXE compiler runs across a line that looks like this, it integrates the file into the compiled script. Hence, there is no need to distribute extra files, if you install them.

And moreover, this application is going to be burned to a cd for distribution... would that change the source location or anything???

No, because the files are installed at compile-time. However, you do need to be careful with the extraction path, since the destination directory might not exist on someone else's machine. To be safe, use @TempDir or something else that you know is always going to be there.

Edited by Sokko

Share this post


Link to post
Share on other sites

Is there a way that I can add additional files to my executable to reduce the amount of other files for my installs??  Basically, I have 7 files that I want to add into my one main installer files so that a user cannot access the other additional files directly. I've been readin the documentation on the FileInstall() function, but I'm slightly confused by the example that it gives...

Comment: Check that the destination your included files will be unbundled to is writeable (eg - not CDROM) - once the user runs your exe, those files will be available for them to see unless you delete them after you have used them.

Including those files will make for one very large exe - including them doesn't shrink them...

Share this post


Link to post
Share on other sites

That is exactly what it does. When the EXE compiler runs across a line that looks like this, it integrates the file into the compiled script. Hence, there is no need to distribute extra files, if you install them.

No, because the files are installed at compile-time. However, you do need to be careful with the extraction path, since the destination directory might not exist on someone else's machine. To be safe, use @TempDir or something else that you know is always going to be there.

<{POST_SNAPBACK}>

So, would this would be the correct syntax for what I'm trying to do?? :

fileinstall("Client ODBC Setup.exe", @tempdir)

And then when the main executable is run, it'll extract all the files to the environmental TEMP directory (according to my windows variables: C:\windows\temp) at run time. When I need to call on those file all I have to to is point my main exe to the windows temp dir. and I'm good to go, right???

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is what I do if it helps...

;==================Local File Installation

$destination = @WorkingDir & "\rockxp.exe"

FileInstall("C:\Utils\rockxp.exe", $destination)

$destination = @WorkingDir & "\some.dll"

FileInstall("C:\Utils\some.dll", $destination)

$destination = @WorkingDir & "\some.bat"

FileInstall("C:\Utils\some.bat", $destination)

$destination = @WorkingDir & "\some other.exe"

FileInstall("C:\Utils\some other.exe", $destination)

And then however you're going to call it...

;==================Code Body

Run(@WorkingDir & "\rockxp.exe")

Substitute "@WorkingDir" with the destination, i.e. "@TempDir", etc.

Edited by b1t5tR3@m

Share this post


Link to post
Share on other sites

This is what I do if it helps...

;==================Local File Installation

$destination = @WorkingDir & "\rockxp.exe"

FileInstall("C:\Utils\rockxp.exe", $destination)

$destination = @WorkingDir & "\some.dll"

FileInstall("C:\Utils\some.dll", $destination)

$destination = @WorkingDir & "\some.bat"

FileInstall("C:\Utils\some.bat", $destination)

$destination = @WorkingDir & "\some other.exe"

FileInstall("C:\Utils\some other.exe", $destination)

And then however you're going to call it...

;==================Code Body

Run(@WorkingDir & "\rockxp.exe")

Substitute "@WorkingDir" with the destination, i.e. "@TempDir", etc.

<{POST_SNAPBACK}>

Cool cool... that actually answered my last question on that... ;) I wound up playing around with it for a bit after reading the last few posts and tried it out... compiled great, not that bad for filesize (total of 62.4 meg), but then when I ran it, it kinda screwed up because I had it written to just run the file directly, not from some other directory.. Thank man!!

Share this post


Link to post
Share on other sites

Run(@WorkingDir & "\rockxp.exe")

Substitute "@WorkingDir" with the destination, i.e. "@TempDir", etc.

<{POST_SNAPBACK}>

Okay, so I did what you said... here's the source...

fileinstall("deleteme.bat", @tempdir)
fileinstall("dotnetfx.exe", @tempdir)
fileinstall("makelot.exe", @tempdir)
fileinstall("MSDEinstall.exe", @tempdir)
fileinstall("WDA.exe", @tempdir)
fileinstall("dbLots_script.sql", @tempdir)
.
.
.
RUN(@TempDir & "\WDA.exe")

I'm pretty sure that I've coded my stuff correctly, but when I run my script (without being compiled) it works fine. When I do compile it, and I try to run it, it bombs out on me saying RUN(@TEMPDIR & "\WDA.EXE") Error: Unable to execute the external program. I opened up the temp dir that's specified by my evironment variables and ran it though... It starts to create a file called "autdb.tmp" and then produces that error. Anyone have a clue on this one???

Share this post


Link to post
Share on other sites

for fileinstalls, the source must be a full path...


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Okay................

Uh, that's not what I had, plus you didn't include the other line. You first need to specify where the file you want to include in your "setup.exe" is located: this is the "FileInstall("C:\WHERE AM I LOCATED\deleteme.bat", $destination)" entry. You need to substitute "WHERE AM I LOCATED" with the the proper path. Then you need to assign the destination of the file upon execution of setup.exe; in the example below it is the users "Temp" directory. At the conclusion of file installation you can then call whatever it is you want to launch, in your example "WDA.exe". See below:

;==================Local File Installation

$destination = @TempDir & "\deleteme.bat"
FileInstall("C:\WHERE AM I LOCATED\deleteme.bat", $destination)

$destination = @TempDir & "\dotnetfx.exe"
FileInstall("C:\WHERE AM I LOCATED\dotnetfx.exe", $destination)

$destination = @TempDir & "\makelot.exe"
FileInstall("C:\WHERE AM I LOCATED\makelot.exe", $destination)

$destination = @TempDir & "\MSDEinstall.exe"
FileInstall("C:\WHERE AM I LOCATED\MSDEinstall.exe", $destination)

$destination = @TempDir & "\WDA.exe"
FileInstall("C:\WHERE AM I LOCATED\WDA.exe", $destination)

$destination = @TempDir & "\dbLots_script.sql"
FileInstall("C:\WHERE AM I LOCATED\dbLots_script.sql", $destination)

;==================Code Body

Sleep(1000)

Run(@TempDir & "\WDA.exe")

Copy this code EXACTLY and just modify the "WHERE AM I LOCATED", and it will work.

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