How do I access the directory of my NSIS Installer inside a Zip File to extract that Zip File? - exe

I want to extract a ZIP File with the .exe inside.
I want to execute the .exe inside the Zip to extract the Zip File.
Already tried it by executing: ZipDLL::extractall "$EXEDIR" "$DESTINATION"
I think that does not work, cause the .exe is stored in the TEMP Folder when opened, so it cannot find the.Zip file
So how do I extract that Zip when executing the .exe from inside the Zip?
Thanks for answers!

Your question does not make a lot of sense, you should just put the files inside the installer and not have a zip file at all.
Even if it made sense, it is not possible because where a exe is executed from when you double click it inside a zip file depends on the zip program you are using and there is no way of getting the path of the zip it was extracted from.
If for some reason you want to be able to update the files inside the zip file without rebuilding the installer you can use a cab file instead. The CabX plug-in supports extracting from cab files appended to the installer exe.

Related

Untar file in specific directory

I try to download a tar.gz file and uncompress it on /tmp/apps.
However i don't want to uncompress it if the directory already exists.
If the file exists or even doesn't exist it is downloaded and uncompressed.
I cant find my code is missing a parameters on my exec block or if I made a mistake somewhere else.
I'm using Puppet 3.8.
Gist file of my puppet
Use the puppet/archive module, https://forge.puppet.com/puppet/archive. It will download the archive, check for existing files and even tidy up after itself.

How to verify the files after unzipping from a zip file (7zip)

How can I verify that the unzipped files are not corrupted after the extraction from the zip file?
Scenario: I am packaging some font files via 7zip and then during installation of the application I am unzipping it and copying it to some specific directory. In some cases, although my unzipping is successful my unzipped files are coming to be corrupted. I am not able to load the font files. Upon investigation, I found that they are somehow getting corrupted.
Is it possible that during extraction, extracted files can get corrupted?
What is the way to check if the extracted files are fine or corrupted?
I can test the zip file using -t flag which checks that all the files are correctly zipped in the zip files but what I want to check is that POST extraction whether the files corrupted or not?
Thanks

How to write to data files in executable created with pyinstaller

I'm making onefile executables with pyinstaller on windows 10. I'm including data files (pickle files) by editing the .spec file...
How can I store changes made to these files during run time? My understanding is that the data files are copied to a temp directory during execution. I can read from the files using the path I get from sys._MEIPASS but the changes I write are lost after restarting the program.
Is there a way to write to pickle files stored inside the exe?

inno setup doesn't decompress each .bin file

I downloaded an iso which contains the files
setup.exe
setup-1.bin
setup-2.bin
It fails to install by executing the setup.exe so I analyzed it with innoextract, which opens just setup-1.bin but not setup-2.bin. Can I manually decompress the .bin files or modify the setup.exe? If yes, how can I do that?
I think the second bin file is just corrupted, so i'm unable to extract it.
That is the reason why Inno Setup cannot continue in installation.
I think this is an answer - you simply need to download the installer again.

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/

Resources