Jump to content
Sign in to follow this  
texan

Including files with compiled version of script

Recommended Posts

texan

I have a script that reads various Excel files for input data. The end user will need to select which Excel file to use for input. I was hoping to give each user a single EXE file for the script and not have to include sending them the Excel files. One EXE would be easier to distribute plus I don't really want the user having the ability to mess with the data conained in the Excel files.

I was wondering if there was some way to created a "compiled" version of my script that is a single .EXE file but somehow contains these Excel files for input?

Share this post


Link to post
Share on other sites
Mechaflash

As long as you don't want to make edits to the file, you can use FileInstall(). This will compile it with the exe and allows you to output it wherever you want, then use it for input. Before the program closes, don't forget to delete the file.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites
texan

FileInstall() does accomplish what I need. I am wondering if there is "best pratices" for using FileInstall(). I currently have it coded as this:

FileInstall("MyExcelFile.xlsx", @TempDir & "MyExcelFile.xlsx", 1)

Any reason this would not work? Many of the end users might not have access to their C: on the PCs. Would @TempDir still work even if they don't have C: drive access?

Share this post


Link to post
Share on other sites
Chimaera

Maybe the path in the first section needs to be complete

From the helpfile

The source path of the file to compile. This must be a literal string; it cannot be a variable or the result of a function call. It can be a relative path (using . or .. in the path) to the source file (.au3).

FileInstall("C:test.bmp", "D:mydirtest.bmp")

An example of one of mine

FileInstall("F:Backup Utilitycompilerobocopy.exe", @SystemDir, 1)
Edited by Chimaera

Share this post


Link to post
Share on other sites
texan

I also wonder if using an Excel file is the best option for what I am doing. I am only using Excel because that is the format the data came to me. The data in the Excel file is not going to change regularly. I will probably get an update to the data once every year at which time I would plan to send out a new version of my AutoIt .exe file. The end users are not all on the same LAN so I can't just place the Excel file there.

The data in the Excel file is not that big, maybe a few thousand lines. I just read it into an array and use it from there. Is there some other way to include this data other than compiling the Excel file with the AutoIt program?

Edited by texan

Share this post


Link to post
Share on other sites
kylomas

texan,

I am only using Excel because that is the format the data came to me.

Does this mean that you get the data from excel, or, is the data in a flat file in comma seperated value format?

kylomas

edit: spelling

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
texan

Does this mean that you get the data from excel, or, is the data in a flat file in comma seperated value format?

The data is in Excel and I use _ExcelReadSheetToArray to put it in an Array. The rest of my AutoIt program works with the Array.

Share this post


Link to post
Share on other sites
kylomas

texan,

As a general rule you do not want to couple data with your program. However, your situation may be an exception to this given the static nature of the data and disparate user base. The real issue will be program/data maintenance. This is one of those "it's your call..." kind of things.

Good Luck,

kylomas

edit: spelling

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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  

×