sahra Posted February 4, 2010 Share Posted February 4, 2010 i compile the au3 file to exe and now i have compile au3 and my setup and i want to know how to compile them to one exe that will run the compile au3and i want to write i My name in the setup..and to do that the setp Could not be openedthank you all Link to comment Share on other sites More sharing options...
MHz Posted February 4, 2010 Share Posted February 4, 2010 FileInstall() may suit your need to store the setup.exe within your compiled executable.Example below:; fileinstall will extract to this path$tempdir = @TempDir & '\MySetup'If FileInstall('setup.exe', $tempdir, 1) Then $pid = Run('"' & $tempdir & '\setup.exe"') ; perhaps some more code here ; wait for window to appear WinWait('Setup Window Title') ; write your name into setup ControlSetText('Setup Window Title', '', 'Edit1', 'My Name') ; perhaps some more code here ; wait for process to finish (added timeout) ProcessWaitClose($pid, 60) ; cleanup DirRemove($tempdir, 1)EndIfCompile with setup.exe in same directory as the au3 script. Link to comment Share on other sites More sharing options...
EDEN2010 Posted February 4, 2010 Share Posted February 4, 2010 FileInstall() may suit your need to store the setup.exe within your compiled executable.Example below:; fileinstall will extract to this path$tempdir = @TempDir & '\MySetup'If FileInstall('setup.exe', $tempdir, 1) Then $pid = Run('"' & $tempdir & '\setup.exe"') ; perhaps some more code here ; wait for window to appear WinWait('Setup Window Title') ; write your name into setup ControlSetText('Setup Window Title', '', 'Edit1', 'My Name') ; perhaps some more code here ; wait for process to finish (added timeout) ProcessWaitClose($pid, 60) ; cleanup DirRemove($tempdir, 1)EndIfCompile with setup.exe in same directory as the au3 script.Can u explain it beter?i have got a several files in folder with the compiled file au3 that i turn in to exenow what to do next to put them all in one file?please helpThank u very much Link to comment Share on other sites More sharing options...
sahra Posted February 4, 2010 Author Share Posted February 4, 2010 FileInstall() may suit your need to store the setup.exe within your compiled executable.Example below:; fileinstall will extract to this path$tempdir = @TempDir & '\MySetup'If FileInstall('setup.exe', $tempdir, 1) Then $pid = Run('"' & $tempdir & '\setup.exe"') ; perhaps some more code here ; wait for window to appear WinWait('Setup Window Title') ; write your name into setup ControlSetText('Setup Window Title', '', 'Edit1', 'My Name') ; perhaps some more code here ; wait for process to finish (added timeout) ProcessWaitClose($pid, 60) ; cleanup DirRemove($tempdir, 1)EndIfCompile with setup.exe in same directory as the au3 script.I did not understand what I should do with that code Link to comment Share on other sites More sharing options...
iamtheky Posted February 4, 2010 Share Posted February 4, 2010 (edited) you could place it, run it, and delete it, while restricting user inputblockinput (1)DirCreate ("C:\temp1") ;creates a temp destinationfileinstall ("setup.exe" , "C:\temp1", 1) ;rolls the setup.exe into your compile and when ran deploys it to c:\temp1, overwriting any other setup.exe in the folder.runwait ("C:\temp1\setup.exe") ; runs the setup from the temp destinationsleep (3000) ; maybe necessary to wait for the setup to completely exit before you recursively delete the folderDirRemove ("C:\temp1", 1) ; removes the c:\temp1 folder and all files and folders within Edited February 4, 2010 by iamtheky Link to comment Share on other sites More sharing options...
cluberti Posted February 4, 2010 Share Posted February 4, 2010 The FileInstall function is documented here. It's worth a read - if you've managed to create an entire autoit script, you should be able to follow that too . Link to comment Share on other sites More sharing options...
MHz Posted February 5, 2010 Share Posted February 5, 2010 Can u explain it beter?i have got a several files in folder with the compiled file au3 that i turn in to exenow what to do next to put them all in one file?please helpThank u very muchPerhaps sahra will also gain some knowledge from your similar question.I usually give an answer as good as the question as I may not know how to respond in a correct manner if the question is not well explained of the issue.Learn by example:(Note: The example is not a working example as the FileInstall() parameters are invalid filenames. The example would need valid filenames to work correct and the same for the previous example I posted above).; UAC Prompt if this script is executed without admin rights. Use this; directive if setup.exe depends on admin rights to install correct.#RequireAdmin; Store the extraction path into a variable named $path_setup.$path_setup = @TempDir & '\extract_folder_name'; The code inside the _Extract() function will execute and will return; a True value if the extraction path was created.If _Extract($path_setup) Then ; Run the setup.exe file within the extraction folder ; and use @TempDir as a valid working directory. ; Note: I used a silent install switch (presume /S) for this example. RunWait('"' & $path_setup & '\setup.exe" /S', @TempDir) ; Remove the extraction path to finish task DirRemove($path_setup, 1)EndIfExitFunc _Extract($path) ; Create a valid folder path to FileInstall() the setup files. If DirCreate($path) Then ; FileInstall() the setup files to the extraction path. ; Note: Change the first parmeters to match your setup files names. ; Note: Add or remove FileInstall() lines as needed. FileInstall('setup.exe', $path & '\', 1) FileInstall('file2', $path & '\', 1) FileInstall('file3', $path & '\', 1) FileInstall('file4', $path & '\', 1) FileInstall('file5', $path & '\', 1) FileInstall('file6', $path & '\', 1) FileInstall('file7', $path & '\', 1) ; Return True value if above condition (DirCreate()) is successful. Return True EndIf ; Return False value if above condition (DirCreate()) fails. Return FalseEndFunc#cs ; Script summary The $path_setup variable is assigned the string value of the path to extract the setup files to. The _Extract() function will then execute the code within it with the $path variable parameter passed to it. The $path parameter has the value of the extraction path. The _Extract() function will return True on successful creation of the extraction path. If the _Extract() function returns True then the RunWait() function will run the path to the setup.exe. The @TempDir working directory parameter used in the RunWait() function helps to ensure a suitable working directory is initially set. The DirRemove() function will then recursefully remove the extraction path previously created by the script.#ceHopefully enough comments have been added to the script to help with understanding.I did not understand what I should do with that codeIt is an example to learn from. The example may help with some ideas to assist you. cluberti offers some good advice of looking at the AutoIt3 documentation to help you learn.DirCreate ("C:\temp1") ;creates a temp destinationThanks for the reminder as I left out the DirCreate() in my first example above which would make FileInstall() fail with a invalid path to extract to. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now