Sign in to follow this  
Followers 0
Hobbyist

Wrapper question

7 posts in this topic

Hi

I am new at all this so my question is at such a level. I have read the help section but again as a new person it is somewhat foreign to me.

Is a wrapper just a way of including additional files with my script at compiling time and those additional files will be active in my compiled script?

So if I have :#AutoIt3Wrapper_Res_File_Add="full path of the file you want to add" as my guide and in my compiling actually had #AutoIt3Wrapper_Res_File_Add="C:My FilesCash Drawer.csv" ,would that file be used when running the script?  Is it embedded into the program itself or is it suppose to show up in the directory/file when the program is installed as a standalone? 

Thank you in advance for any help or direction.

Hobbyist

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

_Res_File_Add can be confusing until you work through some examples of using it.

would that file be used when running the script?

 

It only bundles the file(s) as a resource in the resulting EXE.  They're not written out to your script's directory or anything.  Your script can access them with features like those in the ResourcesEX.au3 UDF.  Think of resources as being "tightly bundled" with the EXE.  Things like additional icons can be accessed by other software like the PC's Properties >> Change Icon feature.  You can view them with any resource editor.

FileInstall() on the other hand, "loosely" bundles files in the EXE and then writes them to the designated file path whenever you run the EXE.  You have the option of overwriting or not.

post-29172-0-85624200-1429710302_thumb.p

Edited by qwert

Share this post


Link to post
Share on other sites

Thanks much.  That definitely helps me understand this a little more.

Also , is there one "best" setup function?  Ok, being new, I don't know if I asked that right.

I am just aware of "setup" disks etc with software I have purchased in the past and was wondering if that  is how a program can get installed on another pc. Some of what I have read is over my head right now.

Thanks again

Hobbyist.

Share this post


Link to post
Share on other sites

Others might have different suggestions, but take a look at the Inno Installer at www.jrsoftware.org.  It's somewhat of a fixture in the world of software distribution.  I've been using it for over 5 years with no problems whatsoever (other than an occasional operator error).  It lets you install about any combination of files onto about any location(s) on the target PC ... and fully supports EULA, desktop icons, startup help, etc.

It can be a little intimidating when you first look at all the options and at some of the more complicated operations.  But just start with the simplest examples and add one thing at a time.  As freeware goes, it's pretty amazing.  Plus, you can also google and find plenty of example of ISS files.

My final advice would be to place all the files that you want installed on a target PC on a single directory on your PC ... and then install that directory using one Inno statement.  That's the simplest way to start.

Hope that helps.

Share this post


Link to post
Share on other sites

qwert

I have another question arising since reading your info/advice, if you don't mind.

If I have an INI file that is used in my script would I use the FileInstall to include the INI file in the compiling process?  And in my script do a file check (for subsequent runs) to see if the INI exists on the stand alone PC and if not then install it?  But wouldn't the app be looking for the INI and thus give an error?  Or would the INI file have to be installed separately so the app could get to the data files? This is all very Greek to me right now.

 

Thanks

Hobbyist

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

A common practice is to use FileInstall() without the overwrite option in order to place the INI file upon the initial operation of the script. But if the FileInstall() should fail for some reason, there are other options.

For example, upon recognizing that the INI file isn’t present, it’s common practice to set default values and write them for the next time the script is run.

It’s also common practice to update the INI file with current parameters upon the script’s exit.

Look at the WriteIni remarks in the Au3 help for useful details, but here are short examples:

Func _LoadINI()
  If FileExists(@ScriptDir & "\Params.ini") Then
    $select = IniRead(@ScriptDir & "\Params.ini", "Prefs", "Selection", "2")
    $size = IniRead(@ScriptDir & "\Params.ini", "Prefs", "Size", "1200")
  Else
    $select = "2"
    $size = "1200"
; write these defaults to create the file for later use
    IniWrite(@ScriptDir & "\Params.ini", "Prefs", "Selection", $select)
    IniWrite(@ScriptDir & "\Params.ini", "Prefs", "Size", $size)
  EndIf
EndFunc

Func _Exit()
; save away the current user prefs (controls can be read at this point)
    IniWrite(@ScriptDir & "\Params.ini", "Prefs", "Selection", $panel)
    IniWrite(@ScriptDir & "\Params.ini", "Prefs", "Size", GUICtrlRead($hInput))
   Exit
EndFunc

 

 

Edited by qwert

Share this post


Link to post
Share on other sites

Got It.  Thanks much for the help and comments.

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