Pangu Posted October 17, 2006 Share Posted October 17, 2006 hello, I will like to know if it is possible to compile a file and an exe in a script for example : file : filesetup executable : setup.exe scritps autoit : install.au3 and compile the whole in a single file install.exe it is possible with autoit because with "fileinsall" doesn't function thank you "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- Link to comment Share on other sites More sharing options...
Xenobiologist Posted October 17, 2006 Share Posted October 17, 2006 Hi, FileInstall() in the helpfile So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Pangu Posted October 18, 2006 Author Share Posted October 18, 2006 yes but for an executable i use : FileInstall(".\setup.exe", @TempDir & "\setup.exe", 0) whereas i have an error for files : FileInstall(".\filesetup", @TempDir & "\filesetup", 0) you are an idea :"> "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 18, 2006 Moderators Share Posted October 18, 2006 yes but for an executable i use :FileInstall(".\setup.exe", @TempDir & "\setup.exe", 0)whereas i have an error for files :FileInstall(".\filesetup", @TempDir & "\filesetup", 0)you are an idea :">The source file must be a string and not a variable so that the compiler can extract the filename to include. The source cannot contain wildcards.You would also need a trailing back slash after @TempDir & '\filesetup\', 0). Each file will need it's own FileInstall(). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Pangu Posted October 18, 2006 Author Share Posted October 18, 2006 these is always the small details that one does not see now now he says to me after having compiled : unable to open the script file however I put well as you said FileInstall(".\files_setup\", @TempDir & "\file_setup\",0) FileInstall(".\setup.exe", @TempDir & "\setup.exe",0) Run(@TempDir & "\setup.exe") "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 18, 2006 Moderators Share Posted October 18, 2006 (edited) these is always the small details that one does not see now now he says to me after having compiled : unable to open the script file however I put well as you said FileInstall(".\files_setup\", @TempDir & "\file_setup\",0) FileInstall(".\setup.exe", @TempDir & "\setup.exe",0) Run(@TempDir & "\setup.exe")I guess you didn't read everything I posted. You can't file install a directory. FileInstall("C:\MyDirectory\Myfile.exe", @TempDir & "\file_setup\", 0)Use the full path to the item you want to install. Edited October 18, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Pangu Posted October 19, 2006 Author Share Posted October 19, 2006 Sorry my english is very bad so it's impossible to compile a file, if I want the whole file I must rather copy it "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- Link to comment Share on other sites More sharing options...
cppman Posted October 19, 2006 Share Posted October 19, 2006 Sorry my english is very bad so it's impossible to compile a file, if I want the whole file I must rather copy it...no... he is saying that you need to tell the compiler what file you want to include in your exe. If you just specifiy the directory it is in, it has no clue which file within the directory to install. try this: #include <file.au3> Func _DirectoryInstall($sDir, $sDestinationDirectory) DirCreate($sDestinationDirectory) $aFiles = _FileListToArray($sDir) For $i = 1 to $aFiles[0] FileInstall($sDir & "\" & $aFiles[$i], $sDestinationDirectory & "\" & $aFiles[$i]) Next EndFunc oÝ÷ Ù«¢+Ø(íáµÁ±(¥¹±Õ±Ðí¥±¹ÔÌÐì)}¥ÉѽÉå%¹Íѱ°¡!½µÉ¥Ù°ÍѽÁ¥ÈµÀìÅÕ½ÐìÀäÈí5å%¹Íѱ±¥±ÌÅÕ½Ðì¤)Õ¹}¥ÉѽÉå%¹Íѱ° ÀÌØíͥȰÀÌØíÍÍÑ¥¹Ñ¥½¹¥ÉѽÉä¤(%¥É ÉÑ ÀÌØíÍÍÑ¥¹Ñ¥½¹¥ÉѽÉä¤($ÀÌØí¥±Ìô}¥±1¥ÍÑQ½ÉÉä ÀÌØíͥȤ(%½ÈÀÌØí¤ôÄѼÀÌØí¥±ÍlÁt($%¥±%¹Íѱ° ÀÌØíͥȵÀìÅÕ½ÐìÀäÈìÅÕ½ÐìµÀìÀÌØí¥±ÍlÀÌØí¥t°ÀÌØíÍÍÑ¥¹Ñ¥½¹¥ÉѽÉäµÀìÅÕ½ÐìÀäÈìÅÕ½ÐìµÀìÀÌØí¥±ÍlÀÌØí¥t¤(%9áÐ)¹Õ¹ Miva OS Project Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 19, 2006 Moderators Share Posted October 19, 2006 ...no... he is saying that you need to tell the compiler what file you want to include in your exe. If you just specifiy the directory it is in, it has no clue which file within the directory to install. try this: #include <file.au3> Func _DirectoryInstall($sDir, $sDestinationDirectory) DirCreate($sDestinationDirectory) $aFiles = _FileListToArray($sDir) For $i = 1 to $aFiles[0] FileInstall($sDir & "\" & $aFiles[$i], $sDestinationDirectory & "\" & $aFiles[$i]) Next EndFunc oÝ÷ Ù«¢+Ø(íáµÁ±(¥¹±Õ±Ðí¥±¹ÔÌÐì)}¥ÉѽÉå%¹Íѱ°¡!½µÉ¥Ù°ÍѽÁ¥ÈµÀìÅÕ½ÐìÀäÈí5å%¹Íѱ±¥±ÌÅÕ½Ðì¤)Õ¹}¥ÉѽÉå%¹Íѱ° ÀÌØíͥȰÀÌØíÍÍÑ¥¹Ñ¥½¹¥ÉѽÉä¤(%¥É ÉÑ ÀÌØíÍÍÑ¥¹Ñ¥½¹¥ÉѽÉä¤($ÀÌØí¥±Ìô}¥±1¥ÍÑQ½ÉÉä ÀÌØíͥȤ(%½ÈÀÌØí¤ôÄѼÀÌØí¥±ÍlÁt($%¥±%¹Íѱ° ÀÌØíͥȵÀìÅÕ½ÐìÀäÈìÅÕ½ÐìµÀìÀÌØí¥±ÍlÀÌØí¥t°ÀÌØíÍÍÑ¥¹Ñ¥½¹¥ÉѽÉäµÀìÅÕ½ÐìÀäÈìÅÕ½ÐìµÀìÀÌØí¥±ÍlÀÌØí¥t¤(%9áÐ)¹Õ¹That won't work Chris... FileInstall() source must be a string, not a variable. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 19, 2006 Moderators Share Posted October 19, 2006 (edited) Here's a rough example of what I think pangu is trying to do:#include <file.au3> $Main = GUICreate('FileInstall Directory', 400, 380) $Edit = GUICtrlCreateEdit('', 10, 10, 380, 300) GUICtrlCreateLabel('Destination Path:', 20, 318, 90, 20, 0x001) $DestinationPath = GUICtrlCreateInput('@TempDir & "\"', 110, 315, 200, 20) GUICtrlCreateLabel('Flag:', 315, 318, 30, 20, 0x001) $Flag = GUICtrlCreateCombo('', 345, 315, 40, 300) GUICtrlSetData($Flag, '0|1|', '0') $GetDir = GUICtrlCreateButton('Directory Get Files', 80, 345, 100, 30) $Copy = GUICtrlCreateButton('Copy Data', 220, 345, 100, 30) GUISetState() While 1 Switch GUIGetMsg() Case - 3 Exit Case $GetDir $Dir = FileSelectFolder('Select a directory to fileinstall', @HomeDrive) If Not @error Then $Files = _FileListToArray($Dir, '*.*', 1) If IsArray($Files) Then Dim $sHold = '', $sRead = GUICtrlRead($DestinationPath), $nFlag = GUICtrlRead($Flag) For $iCC = 1 To UBound($Files) - 1 $sHold &= 'FileInstall("' & $Dir & '\' & $Files[$iCC] & '", ' & $sRead & ', ' & $nFlag & ')' & @CRLF Next GUICtrlSetData($Edit, '') GUICtrlSetData($Edit, $sHold) EndIf EndIf Case $Copy ClipPut(GUICtrlRead($Edit)) EndSwitch WEndNow you don't have to hand write every file, just copy and paste. Edit: Forgot to clear the $sHold var. Edited October 19, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cppman Posted October 19, 2006 Share Posted October 19, 2006 That won't work Chris... FileInstall() source must be a string, not a variable.ah.. kk, i did'nt know that I just tested it without compiling and worked fine.thanks. Miva OS Project Link to comment Share on other sites More sharing options...
Pangu Posted October 20, 2006 Author Share Posted October 20, 2006 (edited) thank you for your script SmOke_N that is not appropriate and CHRIS95219, i don't understand your scriptI need the directory named file_setup because the exe needs the file to continue the installation, when the exe runs, it searchs the files it needs to carry on and if they are not continuous inside it cannot continue. this is why I want to compile it with the exe Edited October 20, 2006 by Pangu "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- Link to comment Share on other sites More sharing options...
JSThePatriot Posted October 20, 2006 Share Posted October 20, 2006 thank you for your script SmOke_N that is not appropriate and CHRIS95219, i don't understand your script I need the directory named file_setup because the exe needs the file to continue the installation, when the exe runs, it searchs the files it needs to carry on and if they are not continuous inside it cannot continue. this is why I want to compile it with the exe Sounds like you need to use FileInstall with DirCreate. DirCreate("C:\Test1\Folder1\Folder2") JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Pangu Posted October 21, 2006 Author Share Posted October 21, 2006 (edited) after one night of reflexion, I realized that the script of Smoke should function here is what that gives me : FileInstall(".\Installer.exe", @TempDir & "\Installer.exe", 0) FileInstall("E:\directory_setup\data1.cab", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\data1.hdr", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\data2.cab", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\engine32.cab", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\layout.bin", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\Datas\Os\98\CATALOG3.CAB", @TempDir & "\directory_setup\Datas\Os\98\", 0) FileInstall("E:\directory_setup\Datas\Os\98\NET10.CAB", @TempDir & "\directory_setup\Datas\Os\98\", 0) and i don't understand why that doesn't function Forgot to clear the $sHold varSmoke, You meant what Edited October 21, 2006 by Pangu "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 22, 2006 Moderators Share Posted October 22, 2006 after one night of reflexion, I realized that the script of Smoke should function here is what that gives me : FileInstall(".\Installer.exe", @TempDir & "\Installer.exe", 0) FileInstall("E:\directory_setup\data1.cab", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\data1.hdr", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\data2.cab", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\engine32.cab", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\layout.bin", @TempDir & "\directory_setup\", 0) FileInstall("E:\directory_setup\Datas\Os\98\CATALOG3.CAB", @TempDir & "\directory_setup\Datas\Os\98\", 0) FileInstall("E:\directory_setup\Datas\Os\98\NET10.CAB", @TempDir & "\directory_setup\Datas\Os\98\", 0) and i don't understand why that doesn't function Smoke, You meant what You have to create the directory "directory_setup" with DirCreate() first before using the fileinstalls. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sshrum Posted October 22, 2006 Share Posted October 22, 2006 You have to create the directory "directory_setup" with DirCreate() first before using the fileinstalls.Sounds like a good suggestion for an future enhancement. I could never understand why most of the file copying functions won't create subdirs if they didn't exist. I know that FILECOPY now supports this via a option parameter but honestly, shouldn't functions like these automatically create the folders (or at least give you the option like the current FILECOPY)?I'm ranting again...time for bed! Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot' Link to comment Share on other sites More sharing options...
this-is-me Posted October 22, 2006 Share Posted October 22, 2006 (edited) Which of the copy operations do you speak of? Edited October 22, 2006 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
Pangu Posted October 26, 2006 Author Share Posted October 26, 2006 I've finally made the compilation for the whole folder from the first window which couldn't manage to pass to the next one, I thus directly launched the second window and there it works, Smoke_N's way of work is thus good. thank you all "Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois- 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