0

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.

Bogdan Botezatu
  • 579
  • 1
  • 9
  • 25
  • For me it looks like you're mixing concepts. A typical _Installer_ is executed only one time, and at the end the user usually have the choice to run or not to run the installed product. This is optional, anyway. If you don't let the user to run your product, doesn't matter they have no way to pass parameters to the main exe, they will execute it later via menu's or command line with proper parameters in place. – jachguate Jul 26 '12 at 16:24
  • Hey there, @jachguate. I'm not sure I got your message right, but the reason I wanted a single exe and not an install-able application is because this is a file forensics tool and I expect it to be highly portable. It is likely that it will be copied often on flash drives and other removable media, and I don't want them to omit any of the application's files. The SFX approach would have been just great. – Bogdan Botezatu Jul 26 '12 at 16:37
  • is what I thought, but you mentioned the word installer. Better if you re-word your question to state "packed exe" or something like that and not installer. BTW, how frequently changes your accompanying files versus your main exe? are you too concerned about reducing the file size or just want to pack all in a single file? – jachguate Jul 26 '12 at 17:08
  • if u really want not installer by unpack-run-cleanup scenario, there is no way to look for installer, i agree. Then current formulation is misleading at least – Arioch 'The Jul 27 '12 at 06:55

2 Answers2

1

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.

Arioch 'The
  • 15,799
  • 35
  • 62
  • Totally agree with that. I looked into 7Zip and it's not only difficult to use, but allows little to no customization. After one day of investigation, I decided to create my own dropper. Thanks for your assistance. – Bogdan Botezatu Jul 27 '12 at 07:15
  • for small simple app that would be best course. for larger proibably PortableApps tooling would be still better BTW dropper might also do other functions, like update chacking-downloader. I remember seeing some launcher exactly for that purpose - to be able to roll up new version in the network, while users still were running (and locking exe) an old one. – Arioch 'The Jul 27 '12 at 08:10
0

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

Arioch 'The
  • 15,799
  • 35
  • 62