creating self-extracting executables with makecab

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
npocmaka_
Posts: 517
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

creating self-extracting executables with makecab

#1 Post by npocmaka_ » 07 Nov 2013 04:46

I'm continuing my childish games with makecab

In the documentation is mentioned the possibility to create a self-extracting archive:

copy /b extract.exe+self1.cab self.exe ; self.exe is self-extracting

But extract is no more available nor in Vista neither in Win7.But after few tests I succeeded to create a self-extracting exe with extrac32.exe .extrac32.exe is an UI application and does not print any help but when executed with an .CAB file as a parameter it will extract it (may be with makecab generated inf file it will be possible to do more things?).

and here's a pretty pretty simple script that creates an self-extracting file:

Code: Select all

@echo off

if "%~2" equ "" (
   echo creates self-extracting exe
   echo USAGE: %~n0 target destination   
)

makecab "%~f1" "%temp%\%~n1.cab"
copy  /b  "%windir%\system32\extrac32.exe"+"%temp%\%~n1.cab" "%~dpn2.exe"
del /q /f "%temp%\%~n1.cab"



EDIT:
extrac32 is not an UI app. to get the help use more --> http_://researchbin.blogspot.com/2012/05/making-and-extracting-cab-files-in.html
Last edited by npocmaka_ on 07 Nov 2013 10:36, edited 1 time in total.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: creating self-extracting executables with makecab

#2 Post by foxidrive » 07 Nov 2013 05:27

It's interesting to follow your posts on this...

Post Reply