7zip command line self extractor not asking for path - 7zip

I've created my self extracting .exe file from 7zip command line using the
7z a -sfx <name.exe> <filelist...>
commands but when I run this from windows explorer it does not ask me for the location to extract the files to, it just places it inside the current directory.
The target users will not be command line savvy so I don't want them to have to open a prompt and use the command line options to put it in a certain directory.
The non command line 7zip has the functionality I'm looking for when checking the box to Create SFX archive file, But the command line does not seem to have it.
As a last resort I can make a .bat script that will call
7z x -o<location> <name.exe>
But I'm trying to avoid that as the users are used to installing form just the executable.

7z a -sfx7z.sfx <name.exe> <filelist...>
http://sourceforge.net/projects/sevenzip/forums/forum/45798/topic/3777973

It seems that if you 7z from the command line, the resulting exe doesn't prompt. But if you use the 7-Zip File Manage, the exe does prompt you.
I don't know why.

You can use the (slightly dated) modified SFX modules that support prompting for the extracting path.

Related

Batch file to rar and password (very specific)

I was trying to make a batch file that compresses a specific folder (using winrar) to a specific location (not the same as the folder location), password (that I can choose myself) protects it AND does all of that without a cmd screen popping up.
I have very little knowledge of programming and managed to get some things working, but not all at the same time and in the same batch file.
Also to rar that file do I need Winrar to be installed on the computer or can I reffer to the rar.exe (copied from the Program Files Windows folder to a different location)?
AFAIK it's not possible to run a a bat file without a visible CMD window without using any additional tools. Here's a link to a post how to run a hidden console: https://superuser.com/questions/62525/run-a-batch-file-in-a-completely-hidden-way
It is possible to use just the rar.exe but I would use 7zip instead. The performance is way better, it's also portable and you have many options in the command line. So your project would contain the bat file itself, the vb script file and the 7z.exe (or rar.exe). If you want, you can even create a single .exe file out of these three by creating a SFX file: http://www.7zsfx.info/en/
Hope I could help you.

How to create and execute a file full of commands on Windows command prompt?

Example:
In Linux we can put the desired commands in a file and give it executable permissions. This helps us to actually run the file on the terminal and thus all the commands inside the file get automatically executed.
How to achieve this on Windows XP?
Same thing, but it's called a batch file, extension is .bat. You can also double-click to run these. This site is a great resource.

How to create an executable command prompt script

I usually perform actions in the 7zip command line program. I was thinking about creating a small script to do everything automatically, but I have never written any Windows shell script before and therefore don't even know where to begin.
I would like to make an executable script file which, when a user double-clicks on it, will call the 7zip command line and perform some actions.
First of all, is this possible? And if it is, what is the best way to do this?
You can create a batch script to do this.
It's basically command line commands that run one after another so you don't have to keep typing them in :)
Put the commands you would normally use for 7zip in a notepad file and save it with the extension .bat, then run it.
7z blah blah params
7z more params and args
All your commands will be executed automatically when the previous one finishes.
There are other programming languages you could do this in (or even VBScript) but batch would be perfectly suited to this, and you don't need to install anything extra.
Batch files can run a series of command line commands. Simply create a text file and name it with the .bat extension.
There are plenty of resources on the internet which will provide you with help.

can't execute cvs command in DOS in windows 7

When cvs is typed in cmd.exe in windows 7 nothing is output. The path of the cvs is already in the PATH :C:\Program Files (x86)\CVSNT\; When typing "C:\Program Files (x86)\CVSNT\cvs" there are outputs there. But when other .exe e.g. calc is typed the corresponding program can be executed. Any idea?
This might sound like a strange suggestion, but try cvs.exe instead of just cvs. Without specifying an extension, your operating system will search for the first file that matches the name, cvs. If it happens to find cvs.bat in one of your paths, then it will execute the .bat file instead of the.exe.
If you have cvs.bat , cvs.com, and cvs.exe within the same directory. The order of precedence would be the following:
cvs.com
cvs.bat
cvs.exe
I have a strong suspicion that there's a blank cvs.bat file hidden somewhere in one of folders defined in your path variable, and that you are actually running this batch file when you type cvs.
HI the answer is Run the exe with full path like "C:\Program Files (x86)\CVSNT\cvs.exe" followed by CVS arguments like -q Checkout.....

How to run exe before or after "RunProgram" from 7zip sfx files setting on config.txt?

I am using 7zip to pack an installation (im using 7z because i need it to work in linux and windows).
From what i've been reading the config.txt file can contains this:
;!#Install#!UTF-8!
RunProgram="Installer.exe"
;!#InstallEnd#!
But what if i need to run another exe before or after running installer.exe? Is it possible like it is in NSIS?
You can specify another progrem in 'RUnProgram' config parameter. Lets say its some .bat file. At the moment program is run, files are already extracted at TEMP location. As your .bat will run then, it can call Installer.exe once script is finished preparations.

Resources