News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Installer

Started by FlySky, July 08, 2012, 12:26:34 AM

Previous topic - Next topic

FlySky

Hey guys,

I am currently interested in coding an installer like Inno setup is capable of but than in ASM.

I noticed an older topic called Unrar Library, is that .lib file/ source code possible to obtain somewhere.
Are there any library for RAR, 7zip or what so ever in ASM?

I am curious on what could be used to get started with it

hutch--

Rewriting them in ASM would be no joy, even if you could access the source code, the best idea is to get the libraries for which ever archiver you prefer and link those libraries into your own application. From my own experience 7zip has the highest compression rate so if install size matters its probably the best to use.

Over time I have seen archivers in both library format and DLL format so you have options here as well. If you are a guru in compression you can write your own but its a highly specialised field and not a simple one to get into.

jj2007

#2
There is e.g. zlib - check if you have it at %ProgramFiles%\Intel\Wireless\Bin\zlib1.dll
Here is a very simple example how to compress a file to *.gz format (attached):

include \masm32\MasmBasic\MasmBasic.inc   ; download
   Init
   Dll "zlib1.dll"   ; will trigger a runtime error if not available
   Declare gzopen, C:2
   Declare gzwrite, C:3   ; C calling convention, 3 dword args
   Declare gzclose, C:1
   Let edi=FileRead$(CL$())   ; make sure the commandline has a valid file!
   mov ebx, gzopen("TheTest.gz", "wb9")
   mov ecx, gzwrite(ebx, edi, LastFileSize)   ; returns # bytes compressed
   void gzclose(ebx)
   Inkey Str$("%i kBytes compressed", ecx/1024)
   Exit
end start

You can get better compression with the LZMA SDK, which is in the public domain thanks to Igor Pavlov. lzma.exe and lzma.txt are the key files in the archive, unless you want to try to compile the included C or C++ sources.

But compression and decompression is only a small part of the work required to write an installer...

ragdog

Hi

It gives many installer exmples with Zip,Cab or Rar
here is a very good example from Florian Mücke it uses Rar lib
and written in Masm

http://code.google.com/p/eis/

Greets,