Ahmedmb Posted March 26, 2005 Share Posted March 26, 2005 i write this Autoit Code to auto creat .7z files or .exe(from sfx Files) but ExE file after built not run the program in SFX comint it alwyes run setup.exe i don't know wherr is error??!!! ;---------------------------------------------------------------------------- ; AutoIt Version: 3.1.0 ; Author: Ahmed Bayomy ; ---------------------------------------------------------------------------- if not FileExists("7za.exe") then FileCopy(@ProgramFilesDir & "\7-zip\7za.exe",@ScriptDir & "\7za.exe") if not FileExists("7z.sfx") then FileCopy(@ProgramFilesDir & "\7-zip\7z.sfx",@ScriptDir & "\7z.sfx") if not FileExists("7zs.sfx") then FileCopy(@ProgramFilesDir & "\7-zip\7zs.sfx",@ScriptDir & "\7zs.sfx") if $CmdLine[0] =0 then MsgBox(0,"Help","Parameters : " & @CRLF & " Folder name to creat 7z file " & @CRLF & " /SFX to creat .EXE " & @CRLF & " Filename to make .exe with autorun this file") Exit EndIf dim $Command,$File $7zFile='"' & $CmdLine[1] & '.7z"' $Command="7za.exe a -t7z -mx9 " & $7zFile & ' "' & $CmdLine[1] & '\*" -r -y' RunWait($Command,"",@SW_HIDE ) if $CmdLine[0] >1 then if $CmdLine[2]="/SFX" Then RunWait(@ComSpec & " /c " & "Copy /b " & @ScriptDir & "\7z.sfx + " & $7zFile & ' "' & $CmdLine[1] & '.exe"',"",@SW_HIDE) FileDelete($7zFile) Else ;~ ----------------------------- dim $7TXT $7TXT=FileOpen(@ScriptDir & "\7z.txt",2) FileWrite($7TXT,";!@Install@!UTF-8!" & @CRLF) FileWrite($7TXT,"RunProgram=" & '"' & $CmdLine[2] & '"' & @CRLF) FileWrite($7TXT,";!@InstallEnd@!" & @CRLF) RunWait(@ComSpec & " /C " & 'Copy /b "' & @ScriptDir & '\7zs.sfx" + "' & @ScriptDir & '\7z.txt" + ' & $7zFile & ' "' & $CmdLine[1] & '.exe"');,"",@SW_HIDE) EndIf EndIf au3SFX.au3 Link to comment Share on other sites More sharing options...
Alterego Posted March 26, 2005 Share Posted March 26, 2005 (edited) i use 7zip in one of my progs. maybe seeing my syntax will help RunWait(@ComSpec & ' /c ' & '7z a ' & $wttSet2[$wikiLoop] & "_" & $lang[$langLoop] & "_" & $plat[$platLoop] & "_TXT.zip " & $wttSet2[$wikiLoop] & "_" & $lang[$langLoop] & "_" & $plat[$platLoop] & "_TXT.tr3>>" & $logFile, @HomeDrive & '\' & $wikiFull[$wikiLoop] & '\' & $lang[$langLoop] & '\' & $plat[$platLoop] & '\', @SW_HIDE) edit...that's probably confusing =) RunWait(@ComSpec & ' /c ' & '7z a ' & 'file.zip ' & 'file.txt', @WorkingDir, @SW_HIDE) Edited March 26, 2005 by Alterego This dynamic web page is powered by AutoIt 3. Link to comment Share on other sites More sharing options...
Ahmedmb Posted March 27, 2005 Author Share Posted March 27, 2005 What's mening of all thes Variable??? Link to comment Share on other sites More sharing options...
Alterego Posted March 27, 2005 Share Posted March 27, 2005 a severely nested loop lol This dynamic web page is powered by AutoIt 3. Link to comment Share on other sites More sharing options...
Ahmedmb Posted March 27, 2005 Author Share Posted March 27, 2005 can u add Completed code? Link to comment Share on other sites More sharing options...
Alterego Posted March 27, 2005 Share Posted March 27, 2005 first, make sure you put 7za.exe in your @HomDriv & '\Windows\ directory. i renamed mine to 7z RunWait(@ComSpec & ' /c ' & '7za a -t7z -mx9 " & $7zFile & ' "' & $CmdLine[1] & '\*" -r -y',"",@SW_HIDE ) This dynamic web page is powered by AutoIt 3. Link to comment Share on other sites More sharing options...
Ahmedmb Posted April 6, 2005 Author Share Posted April 6, 2005 THX but thes will not creat exe file? 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