RARSFX / ZipSFX - Passing a parameter to in-archive file

937 views Asked by At

I've finished working on an application and it's now time to deliver it to the customer. Since it is a 5-file application which is smaller than 5 MB, i decided that the simplest and leanest way to deliver it would be as a RARSFX/ZipSFX file that is instructed to unpack everything in the temp folder, then launch the main executable file in my project.

Everything works OK until now, I chose ZipSFX as the default format, but the problem is that I designed my main exe to accept parameters (namely -batch (process a batch of files) and -nolang (do not localize app). However, when packed with ZipSFX, the user would actually pass the parameters to the installer, not to the main exe.

Is there a way to "route" the parameters to the main application? Thank you in advance.

2

There are 2 answers

2
Arioch 'The On BEST ANSWER

Root comments are interesting...

If u really want not installer by unpack-run-cleanup scenario, there is no much use to look for installer, i agree. 1 approach would be looking at PortableApps. They do such tricks constantly with much more complex and exacting programs and probably has great tools to achieve it.

Another approach would be to have needed files stored in main application as resource, then unpacked to %TEMP% and used form there, and deleted on exit. That is how SysInternals tools install their temporary drivers. Most basic way should be using Microsoft Resource Compiler. some languages like Delphi have their native components for data storing.

Doing this you can make a small stub exe, that drop-shot main app, run it, wait for completion and cleaning up (more reliable vs main program crashes) or make you main program do all that itself (but it would leave trash behind itself if crashed or exited unusual way) You may choose dropper to eb packed with tools like UPX, but main exe's and DLLs should remain unpacked.

You may mark the temp files with cache dir tag to make a small hint that you can freely delete them if found stray.

1
Arioch 'The On

Did you look at InnoSetup ? It is written in Delphi so probably would be easy for you to use with little overhead. I think you can easily script it to pass some params down the stream.


Did you try 7-zip sfx ? some installers like Opera are made after it.

7-zip stock SFX seems to pass parameters down the chain. http://sourceforge.net/projects/sevenzip/forums/forum/45798/topic/4788506

7-zip extended SFX has special option to pass the rest of parameters down the chain. http://7zsfx.info/en/switches.html#breakcmdline