MrChris Posted September 18, 2006 Share Posted September 18, 2006 I searched the Scripts and Scraps but didnt really find what I was maybe looking for but, Is there any script that might already be made to Automaticly parse a whole folder for files and subfolders and populate it to a AU3 file with FileInstall functions? Kinda like the Reg2AU3 one someone refered me to a while back? Thanks, MrChris Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 18, 2006 Moderators Share Posted September 18, 2006 Won't work, the FileInstall() has to be a litteral string for the "Source". Unless you want to have it to copy the .au3 in question and write the found input to a new .au3 and delete the old one. Shouldn't be hard to do that... You can use a directory recurse ... and FileWriteLine or FileWriteToLine or FileRead()/FileDelete()/FileWrite() 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...
MrChris Posted September 18, 2006 Author Share Posted September 18, 2006 Unless you want to have it to copy the .au3 in question and write the found input to a new .au3 and delete the old one.This might be Ok i think. I was just looking to parse an entire folder that has like 100+ files in it in different subfolders then take that output and past it into my AU3 file where I need it to go. Is there a script that does this already or close to it?MrChris Link to comment Share on other sites More sharing options...
MHz Posted September 18, 2006 Share Posted September 18, 2006 My contextmenu extension program "CMenu" does have the ability. You can find it here. Link to comment Share on other sites More sharing options...
GoogleDude Posted April 19, 2007 Share Posted April 19, 2007 I am also trying to parse a folder for all files to output to a AU3 file to use via the FileInstall function. How can this be done in CMenu? I dont understand where in CMenu this can be done. Thanks, GoogleDude Link to comment Share on other sites More sharing options...
evilertoaster Posted April 19, 2007 Share Posted April 19, 2007 Perhaps this may also work for you http://www.autoitscript.com/forum/index.php?showtopic=27237 Link to comment Share on other sites More sharing options...
GoogleDude Posted April 20, 2007 Share Posted April 20, 2007 Please forgive my ignorence but how do I use that to parse a folder for file names to use with FileInstall in my script. I played with it but it looks like its a Installer that someone made. I will admit that there is a LOT about AutoIt I have to learn. GoogleDude Link to comment Share on other sites More sharing options...
MHz Posted April 20, 2007 Share Posted April 20, 2007 Just use AutoIt Archive Script in SendToA3X (the successor/alternative to CMenu). Right click on the folder to process and use Send To -> AutoIt Archive Script. It should create a Au3 script outside of the folder with all the FileInstall()'s done for you so you can then just enhance on the functions created for you. Link to comment Share on other sites More sharing options...
tAKTelapis Posted April 20, 2007 Share Posted April 20, 2007 (edited) I was working on a systme for automatically producing installers by wrapping an entire directory, here is the code i came up with: It works to an extent, but i never got it fully polished.. sounds like what you want. (im sure i posted a thread about it, but apparently not) expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.2.0 Author: tAK Script Function: Automatically Create AutoIT v3 script containing FileInstall details for Entire directory Tree #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <file.au3> #include <Array.au3> Dim $a_FilesToInstall $au3ScriptFile = FileOpen("C:\TEMP\WrappedInstallFile.au3", 10) $BatFile = FileOpen("C:\TEMP\GetDir_Batfile.bat", 10) $Folder = FileSelectFolder("", "") $Drive = StringLeft($Folder, 2) FileWriteLine($BatFile, "@ECHO OFF") FileWriteLine($BatFile, "CD "&'"'&$Folder&'"') FileWriteLine($BatFile, $Drive) FileWriteLine($BatFile, "Dir /b /s >>C:\TEMP\FilesToInstall") FileWriteLine($BatFile, "exit") FileClose($BatFile) RunWait("C:\TEMP\GetDir_Batfile.bat", "", @SW_HIDE) FileDelete("C:\TEMP\GetDir_Batfile.bat") _FileReadToArray("C:\TEMP\FilesToInstall", $a_FilesToInstall) ;_ArrayDisplay($a_FilesToInstall, "a_FilesToInstall") FileDelete("C:\TEMP\FilesToInstall") $x = 1 For $x = 1 to $a_FilesToInstall[0] - 1 $IsNotAFolder = FileGetAttrib($a_FilesToInstall[$x]) If StringInStr("D", $IsNotAFolder, 0) >= 1 Then FileWriteLine($au3ScriptFile, 'DirCreate("'&$a_FilesToInstall[$x]&'")') ContinueLoop Else FileWriteLine($au3ScriptFile, 'FileInstall("'&$a_FilesToInstall[$x]&'", "'&$a_FilesToInstall[$x]&'", 1)') EndIf Next FileClose($au3ScriptFile) Exit Edited April 20, 2007 by tAKTelapis 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