Sign in to follow this  
Followers 0
Guest Beefteck

Self Installer

7 posts in this topic

Ok, I have made a great self installer for my new up coming release of K.I.O. v1.0 Beta Release 1.

My problem is though that I have all the files I need all ready in paths that will work, but when I file install/file copy to c:/program files/ it will only copy the files in the first folder and not the sub folders or the folder that holds all the data "K.I.O. v1.0" I need it to copy that folder with all data and sub folders... but how? :P

any ideas?

Thanks for the help!

-Beefteck

Share this post


Link to post
Share on other sites



No thanks I think I'll pass until it works :P

Besides. I Think you will get better answers if you provide a little bit of code. The file install/copy routines maybe?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Here is the full code, I need the full directory with all data and subfolders...

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.1.11 (beta)
;~  Author:      Adam (Beefteck) (kiosuppot@aol.com / )

 Script Function:
    K.I.O. v1.0 Install Function

#ce ----------------------------------------------------------------------------

#include <GUIConstants.au3>
#include <Animatewindow.au3>
;-------------------------------------------------------------

$GUI5 = GUICreate("Install K.I.O. Extras", 300, 200)

$extra3 = GUICtrlCreateLabel("Please select an option below.",10, 10, 290, 40)
GUICtrlSetColor(-6, 0x8E6409)

$startup1 = GUICtrlCreateButton("Run on Startup", 10, 40, 80, 40)

$quit3 = GUICtrlCreateButton("Never mind, EXIT", 10, 100, 100, 40)

GUISetState(@SW_HIDE)

;-------------------------------------------------------------

$GUI4 = GUICreate("Install Finished!", 300, 200)

$extra1 = GUICtrlCreateLabel("Install Done!!! Would you like to install extras like run on start up etc.? Or would you like to quit?", 10, 10, 290, 40)
GUICtrlSetColor(-5, 0x8E6409)

$extra2 = GUICtrlCreateButton("Yes, Install K.I.O. Extras!", 80, 70, 150, 40)

$quit2 = GUICtrlCreateButton("No, Exit this installer.", 80, 140, 150, 40)

GUISetState(@SW_HIDE)

;-------------------------------------------------------------

$GUI3 = GUICreate("Please Wait Install Taking Place!", 300, 200)

$fileok = GUICtrlCreateLabel("Please wait, this window will close and tell you if the install was succsessful. Please Wait...", 10, 10, 290, 50)
GUICtrlSetColor(-4, 0x8E6409)   

GUISetState(@SW_HIDE)

;-------------------------------------------------------------

$GUI2 = GUICreate("Are you sure???", 300, 200)

$sure1 = GUICtrlCreateLabel("You are about to install Keyed It Options v1.0 Beta Release 1. Are you sure that you want to do this? Do you also agree with our licences? If so click 'YES', if not click 'NO'", 10, 10, 290, 50)
GUICtrlSetColor(-3, 0x8E6409)   

$yes1 = GUICtrlCreateButton("Yes, Install K.I.O.", 100, 70, 100, 40)

$no1 = GUICtrlCreateButton("No, Exit this installer.", 80, 140, 150, 40)

     GUISetState(@SW_HIDE)

;-------------------------------------------------------------

$GUI1 = GUICreate("Keyed It Options v1.0 Installer Beta 1 (C) Beefteck", 600, 400)

GUISetBkColor(0xC0C0C0)

;-------------------------------------------------------------
$font1 = ("Monotype Corsiva")
;-------------------------------------------------------------

$intro1 = GUICtrlCreateLabel("Welcome to the Keyed It Options v1.0 Auto Installer Beta 1", 50, 10, 500, 50)
GUICtrlSetFont (-1, 16, 400, 0, $font1)
GUICtrlSetColor(-1, 0x8E6409)

$install = GUICtrlCreateButton("Install Keyed It Options v1.0 Beta Release 1", 300, 100, 250, 40)

$close = GUICtrlCreateButton("Close", 400, 180, 40, 40)

GUICtrlCreateLabel("Welcome to the new beta self installer of K.I.O. v1.0! Using this program K.I.O. will install itself. As of now this will install the following verion: Keyed It Options v1.0 Beta Release 1. If you do not agree to any of our licences found at http://www.freewebs.com/beefteck/licence then please click the close button above, otherwise please click the install button at the top and please wait till next prompt from K.I.O. Thank-you for using K.I.O. and please feel free to donate!", 100, 275, 400, 100)
GUICtrlSetColor(-2, 0xFF0000)

GUICtrlCreatePic(@ScriptDir & "\Data\installer\resources\logobr1.jpg", 5, 40, 270, 230)

;-------------------------------------------------------------

GUISetState()

While 1


        $msg = GUIGetMsg()
        $try = TrayGetMsg()
;-------------------------------------------------------------
If $msg = $GUI_EVENT_CLOSE Or $msg = $close Then ExitLoop
;-------------------------------------------------------------

;~ GUI 1

If $msg = $install Then GUISetState(@SW_HIDE, $GUI1)
     If $msg = $install Then GUISetState(@SW_SHOW, $GUI2)

;-------------------------------------------------------------

;~ GUI 2

If $msg = $no1 Then ExitLoop
    
If $msg = $yes1 Then GUISetState(@SW_HIDE, $GUI2)
     If $msg = $yes1 Then GUISetState(@SW_SHOW, $GUI3)
         If $msg = $yes1 Then FileInstall(@ScriptDir & "\Data\installer\Data\Keyed It Options v1.0", "C:\Program Files\")
             If $msg = $yes1 Then Sleep(2000)
                 If $msg = $yes1 Then GUISetState(@SW_HIDE, $GUI3)
                     If $msg = $yes1 Then SoundPlay(@ScriptDir & "\Data\installer\resources\install done.wav")
                         If $msg = $yes1 Then GUISetState(@SW_SHOW, $GUI4)


;-------------------------------------------------------------

;~ GUI 4

If $msg = $quit2 Then ExitLoop
    
If $msg = $extra2 Then GUISetState(@SW_HIDE, $GUI4) 
     If $msg = $extra2 Then GUISetState(@SW_SHOW, $GUI5)
;-------------------------------------------------------------

;~ GUI 5

If $msg = $quit3 Then ExitLoop
    
If $msg = $startup1 Then GUISetState(@SW_HIDE, $GUI5)
     If $msg = $startup1 Then GUISetState(@SW_SHOW, $GUI3)
         If $msg = $startup1 Then FileCopy(@ScriptDir & "\Data\installer\Data\ttt2.txt", "C:\")
             If $msg = $startup1 Then Sleep(2000)    
                 If $msg = $startup1 Then GUISetState(@SW_HIDE, $GUI3)
                     If $msg = $startup1 Then SoundPlay(@ScriptDir & "\Data\installer\resources\install done.wav")
                         If $msg = $startup1 Then GUISetState(@SW_SHOW, $GUI4)

;-------------------------------------------------------------

Wend

GUIDelete()

ps it works fine (kio) but the installer is not done yet...

Edited by Beefteck

Share this post


Link to post
Share on other sites

You really need to read the FileInstall help page :P

The first thing that comes to mind is:

The source path of the file to compile. This must be a literal string; it cannot be a variable.

Another note is that the code provided seems to be rather fare from the problem you described.

Share this post


Link to post
Share on other sites

Hey, I understand your problem, it's nearly exactly what you first described, it does not contain a variable (unless a macro is a variable), and wow people get very offensive over nothing....

But sadly I can offer no help. Just do each item individually...


If I post a code or snippet, please tell me what I did wrong and/or what I can do better. Tell me my code/idea sucks, if it does. If I ask for help, refrain from only telling me to search the help file and/or the forums. I will search before asking, I just may not have searched with good keywords. If I say that I will look into something or fix something later, understand that I am most likely lying.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

ok, i will try them individually, BUT how would i create a folder because i can not get the folder copied...

EDIT: OK all set i was reading around and found a create directory option, took me like 20 min on top of like 2 hours from earlier (this was what I was looking for anyway) thanks guys

-Beefteck

Edited by Beefteck

Share this post


Link to post
Share on other sites

I made a script a while back that does this for you. Simply give the function the application directory. Then give it the location to install it to on the target machine, the second parameter must be a literal string. You may include macros, but they must be within the string.

Example:

GetFiles(@ScriptDir & "\My Application Folder\", "@ProgramFilesDir & '\My Application Install Folder'")

or

GetFiles(@ScriptDir & "\Application\", "@MyDocumentsDir & '\Application Projects")

Do not add a trailing backslash to the second parameter!!!

Download it here:

InstallScriptGeneratorv1.0.0.5.au3


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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