efficacious Posted August 27, 2008 Share Posted August 27, 2008 hello everyone, I kno this isn't exactly php but I am using it with a php application that i'm making.. Basically I'm creating a executable file by using the php function exec().. paired up with WinRAR Archiving Program.. I have everything working perfectly except for 1 lil bothersome issue that absolutely must be resolved for the process to be successfull.. I have googled I have plain just tryed toying with different options.. I have been to winRARs site and read through the knowledge base and have even emailed winRAR support.. (Whom I just emailed earlier and am still waiting a response) But, If anyone should happen to know this plz plz share.. The issue: I need some sort of switch command that will let me set an extraction path.. Currently the extraction path defaults to the path I use to store the exe after creation.. Which is c:\server\wwwroot\updates I need to be able to dynamically set an extraction path.. which If I can locate some sort of switch command to set a path then I can use php to handle the dynamic ability. Things I've tried: Path=c:\Program Files\ProgramFolder\ Path=ProgramFolder -d c:\Program Files\ProgramFolder neither of these work.. Now winRAR does have an extraction path command BUT winRAR only allows use of one command per query which that command is already being used via the create process.. And even if I could use it (x) that command would start executing the extraction which is not what I'm trying to do. hope all this makes some sense! thanks for suggestions guys, eff ps(If anyone knows of another program that can fullfill these needs plz do share) Quote Link to comment https://forums.phpfreaks.com/topic/121567-solved-winrar-command-line/ Share on other sites More sharing options...
discomatt Posted August 27, 2008 Share Posted August 27, 2008 This may help http://www.respower.com/page_tutorial_unrar BTW - are you dealing with RAR archives, or simply using winRAR to extract ZIPs? Quote Link to comment https://forums.phpfreaks.com/topic/121567-solved-winrar-command-line/#findComment-626988 Share on other sites More sharing options...
efficacious Posted August 27, 2008 Author Share Posted August 27, 2008 I'm actually creating SFX executables dynamically Quote Link to comment https://forums.phpfreaks.com/topic/121567-solved-winrar-command-line/#findComment-627119 Share on other sites More sharing options...
efficacious Posted August 27, 2008 Author Share Posted August 27, 2008 I've actually read through that page before its not quite what i'm doing.. I'm using the command line to CREATE .exe files aka.. SFX archives... And I'm not extracting anything.. I need to set the default extraction path for the executable. Quote Link to comment https://forums.phpfreaks.com/topic/121567-solved-winrar-command-line/#findComment-627123 Share on other sites More sharing options...
efficacious Posted August 28, 2008 Author Share Posted August 28, 2008 Well because I'm deciding to be nice.. I've decided to go ahead and share this "hard to find" fix with everyone who may need it. How to give your SFX archive a default extraction path: In order for this to work we must create a 'comment.txt' file now the name of the txt file doesn't have to be 'comment' however it should be of extension '.txt' I know what your thinking..how does a comment file help solve the problem of adding a default extraction path in the command line. Well WinRAR allows comment files to hold special commands lil something you don't find in the help files. So.. In (Comment.txt): Open it up in a txt editor and add one of the following lines of code to it. Path=C:\FOLDER\PROGRAM or Path=Program (By Default the path would be C:\Program Files\Program) thats it. Now to include this in our command line code winRAR normally requires you to do this Command: WinRAR C c:\path\to\comment.txt However if you are like me and your already using the 'a' command. You cannot use the command 'c' Reason for this is that winRAR will only allow 1 command per query. So For those like me that need this all to happen in one shabang. We can use the switch '-z' like so: Command: WinRAR a -sfx file.exe -z comment.txt c:\path\to\files\to\compress\ hope this helps somone out there..! thanksz, eff Quote Link to comment https://forums.phpfreaks.com/topic/121567-solved-winrar-command-line/#findComment-627762 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.