Jump to content
Sign in to follow this  
tris20

include exe files to script/compile

Recommended Posts

Hi guys.

 

search around all over the place watched youtube and everything but i cant get this to work. 

what i want is the following.

 

i wanna make a script that automates some installers. so i want to include an exe file and then the file must come in the script and when compiled in the output folder. yes i know use fileinstall. this isnt the problem. that file that is in de compiled file i want that to copy to a specified folder.  this is what i have so far. i hope some one can help me in the right direction. 

 

sorry for my bad english and i am just a starter in coding.

programma.au3

Share this post


Link to post
Share on other sites

You have the parameters for FileInstall() wrong as you have 3 and the function only takes 2.

Fileinstall ("c:\cleanfiles\ninja.exe", @ScriptDir, "c:\Cleaning")

Just specify the proper target directory as the second parameter.

8 minutes ago, tris20 said:

sorry for my bad english

Gaat prima. ;)

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Bedankt haha

Maar als in het Nederlands even kan heel fijn. 

 

Ik heb het deel met @scriptdir ook weg gelaten en dan nog lukt het niet. Als ik het script compile dan zit de exde er wel in maar hij zet het bestand dan niet in die folder cleaning

Share this post


Link to post
Share on other sites

Nah, let's keep on using English around here as else most other won't understand it anymore. ;)

2 hours ago, tris20 said:

Ik heb het deel met @scriptdir ook weg gelaten en dan nog lukt het niet. Als ik het script compile dan zit de exde er wel in maar hij zet het bestand dan niet in die folder cleaning

So where exactly would you like the included file to be store when the compiled script is ran?

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I want the exe file to be copied to c:\cleaning 

But that files must be in the compiled script. 

 

Let's say I want to make one big file with multiple exe files to be as one. And then when I run the script I press a button in the menu I make and then that exe files is run from c:\cleaning.

Share this post


Link to post
Share on other sites

Ok, so what did you change the fileinstall statement to?

Is that subdirectory already existing or does it need to be created?

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

With statement do you mean the flag. Yes I did it with flag. 

 

The directory where it needs to be would be created by the script. I even put in an 10 sec sleep before going to the fileinstall. 

Share this post


Link to post
Share on other sites

this is the code now,

;#RequireAdmin

; folders
DirCreate ("c:\Cleaning")

sleep(10000)

; programs
; systemninja

Fileinstall ("c:\cleanfiles\ninja.exe", "c:\Cleaning", 1)

; menu begin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Retro\Documents\autoit\CleaningMenu.kxf
Global $Cleaning = GUICreate("Cleaning", 615, 437, 192, 124)
Global $Systemninja = GUICtrlCreateButton("Systemninja", 16, 16, 155, 41)
Global $DeleteFolder = GUICtrlCreateButton("DeleteFolder", 440, 384, 155, 41)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

; menu einde

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        case $DeleteFolder
            DeleteFolder()

        case $Systemninja
            Systemninja()

    EndSwitch
WEnd

Func DeleteFolder()

    DirRemove ("c:\Cleaning")

EndFunc

func Systemninja()

    run ("c:\Cleaning\ninja.exe")

EndFunc

 

Share this post


Link to post
Share on other sites

Try adding the target filename as well to the FileInstall():

;#RequireAdmin

; folders
$rc = DirCreate ("c:\Cleaning")

; programs
; systemninja

$rc = Fileinstall ("c:\cleanfiles\ninja.exe", "c:\Cleaning\ninja.exe", 1)

There should be no need for the pause. It also helps to test the returncodes of the functions to find out whether they were successful.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

omg i feel so stupid i tried everything and whatched many videos and been trough the help file alot and such a simple thing soveld it.

 

thanks alot man thanks. youve beengreat help.

 

ill try out those $rc = currious to see what happens then.

 

thanks again!

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...