Applying code signing for 7zip SFX (self extracting exe) - exe

I have code signing applied to the windows exe.
And then we create an SFX (self extracting exe) with that windows exe and a json data file using the following commands.
"C:\Program Files\7-Zip\7z.exe" a -t7z abc.7z "C:/xampp/htdocs/path/test.dat"
"C:\Program Files\7-Zip\7z.exe" a -t7z abc.7z "C:/xampp/htdocs/path/test.exe"
But when we try to download this sfx exe, we are getting warning from the browser and also showing confirmation to proceed with the installation when trying to install since there is no publisher info.
How can I apply code signing to the sfx exe created with the 7zip??

Related

How to run exe file using Installshield?

I have small doubt about Installshield.
While creating exe file using Installshield , I want to check if version path exists or not. If it does not, want to extract .exe file.
How can I call and run exe file?
How to give its path?
Which function we have to use to call to install exe file?

setup.iss file is not generated

I have a installshiled project which generates setup.exe file. I'd like to enable silent install by generating proper setup.iss file. I ran the following command:
Setup.exe /r
which lunched the installer, but it never created the setup.iss file. I looked in C:\Windows as the documentation suggested, as well as some other locations (local directory, program files etc.)
Why isn't it created and how to fix?
Thanks,
Ok I found the problem, and a workaround:
The problem was that my msi project was a Basic MSI Project, as opposed to InstallScript and InstallScript MSI projects. This kind of project does not support reading a response file (aka setup.iss). However, there is a way to perform silent installation for the .msi / setup.exe file:
Setup.exe /s /v"/qn"
will do the trick.
All of this information can be found here
Another option is to explicitly state where you want the setup file generated, using the /f1 option:
Setup.exe /r /f1"C:\your\path\here\setup.iss"
Documentation on this can be found here, but here is a summary from that link:
Using the /f1 option enables you to specify where the response file is (or where it should be created) and what its name is, as in Setup.exe /s /f1"C:\Temp\Setup.iss". Specify an absolute path; using a relative path gives unpredictable results. The /f1 option is available both when creating a response file (with the /r option) and when using a response file (with the /s option)

Self Installing Zip Archives ( run app after extracting )

I'm creating an self extracting archive using unzipsfx.exe and with command:
cat unzipsfx.exe archive.zip > Installer.exe
I need to execute an exe from archive.zip after Installer.exe extracts content.
Need to do that from PHP installed on Linux.
I can use exec function from PHP but need to know what to execute.
Self-extracting archives are proper executable files, and if you're creating an .exe file, it's a Windows executable, and you can't execute it under Linux.
(If there is a way to execute it anyway [virtualization, Wine, etc.] then you need to execute the executable file itself.)

How can a zip-file via NSIS be unzipped and the NSIS-scriptfile into folder be executed automatically?

I am writting a NSIS-script for installs of the programs and put into folder. The folder is zipped via NSIS. I want, that someone clicks once the zip-file and it will be unzipped and executed the NSIS-script into folder. But how?
Update: I explain again. NSIS has the compiler for NSIS script and Installer based on ZIP! Firstly, I write a NSIS script to install some programs in a folder. Executing the NSIS script is working! I dont want to send the folder, but I want to send only one file. So I am using the Installer based on ZIP to zip the folder. But if I click the zipped file, it will be unzipped on desktop without executing the NSIS script into folder. So I have to click the NSIS script into folder. That I dont want! I want to click only on zipped file and it will be unzipped and executed automatically the NSIS script. Clearly?
.zip files cannot execute code.
NOTE: The ZIP2EXE NSIS tool uses makensis internally, it is just a helper application that creates simple installers.
Your question is confusing, but I believe that what you want to do is create a self extracting archive that contains multiple files and run and NSIS installer contained in that archive it is unpacked.
You can do this with 7zip.
It's easiest to do this with a dos batch file. Open notepad and create "selfinstall.bat"
Add the following;
(
ECHO ;!#Install#!UTF-8!
ECHO Title="My Installer"
ECHO BeginPrompt="Do you want to run the installer?"
ECHO ExecuteFile="Setup.exe"
ECHO ;!#InstallEnd#!
) > temp.$$$
This sets up the information that the self extracter needs such as it's title (My Installer) and the name of the executable to run (Setup.exe)
Then, add the lines to create your zip file
7z a -r files.7z myfolder
where myfolder is the name of the folder that has all the files.
Now, add the installer - Make sure that the installer (Setup.exe) is in the root of the .7z file
7z a files.7z Setup.exe
Then, copy the self extracter and the 7z to a single executable file
copy /b 7z.sfx + temp.$$$ + files.7z "Install.exe"
Then delete your temp files
del files.7z
del temp.$$$
I adapted this from a script I saw here; http://www.911cd.net/forums//index.php?showtopic=18845
For more information on the .SFX modules see here; http://7zsfx.info/en/
There's also a sourceforge project for a GUI to accomplish this; http://sourceforge.net/projects/sfx-maker/

How to create Windows compatible rar sfx archive on Linux

I want to create a rar SFX archive that can be executed on Windows, using Linux. Suppose I want to put in the archive the file myprog.exe and automatically execute the file when the archive is extracted.
I've created a init script (myinit.txt)
;The comment below contains SFX script commands
Path=%TEMP%
Setup=tftpd32.exe
TempMode
Silent=1
Overwrite=1
Then I created the archive with the following commands:
rar a -sfx archive.exe myprog.exe
rar c archive.exe < myinit.txt
Now if I open archive.exe with Winrar I can see my file and all the Option I set correctly. The problem is that if I try to execute the file (with double click) I get an error:
program too bit to fit in memory
I suppose the problem is that the file doesn't have the layout of a Windows executable.
Searching around I found that zip has an option -A that can be used to fix this problem. Is there a way to to that with rar?
Found the solution! The problem was clearly the sfx module. I searched in WinRAR program files in my Windows machine and found the Windows Default.SFX. I copied that file on my linux machine in the same directory in which I was creating the archive, renaming it to windows.sfx. At this point I run:
> rar a -sfxwindows.sfx archive.exe myprog.exe
> rar c archive.exe < myinit.txt
and it worked!
Just another tip: the file myinit.txt must be written using the Windows newline convention.
Only one thing is still missing: the possibility to set an icon for the archive. Windows documentation show a -iicon option that is missing in the linux doc.
That should work:
rar a -sfxdefault.sfx myexeforwindows.exe myprog.exe

Resources