I want to create a self-extracting file (SFX) named Setup.exe which contains a Windows application with some dependencies.
It is possible to start the Windows application with arguments, and I would like to put them at my Setup.exe and then it should pass them to the Windows application. Furtermore, I would like to pass the Windows application exit code to the Setup.exe.
Currently I have tried to use 7zip, but it seems that it isn't sufficient.
Is it even possible with 7z or do you know how to do with other tools?
You've asked a lot of questions and I am trying to answer a few here, maybe not all of them.
Yes it is possible to start a Windows Application with arguments. Ideally for that you need to open command prompt and navigate to the directory of your application then type in
theProgramName.exe - arguments optionsbut that I assume you already know.Another approach would be to
Create ShortCutfor the Program you are targeting and then you can just Right click -> Properties -> and append your arguments to theTargetfield. Example :C:\Games\Counter-Strike\hl.exe -steam -game cstrike -noforcemparms -noforcemaccelAnother approach that I assume you would want when you are creating a SFX is to create a
.bat(batch) file with the contents beingtheProgramName.exe - arguments optionsand put it in the same directory as your program and set it to run as our main application when it extracts. If you want theexeand not thebatyou can use some bat to exe conversion tools, there are tons out there.The best way I can think of is using programs like Advanced Installer. You can directly make an
msior asfxand send a shortcut anywhere (more than one) and it could contain arguments you specify just like what I described in the second way.So yeah that other tool I'd vouch for that will do what I think you want to do is Advanced Installer.