News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Installers and Uninstallers

Started by ossama, December 29, 2007, 04:27:26 PM

Previous topic - Next topic

ossama

Quote from: Jackal on January 01, 2008, 11:36:30 PM
if a mod says that it is ok to post this type of code then yes i will. I have not tested it on 9x but it does work on xp and vista.

is it against the rules of this forum?

Jackal

i believe it would fall under no viral code.

ossama

i have sent hutch-- a request if your code can be posted here.waiting for response ...

BogdanOntanu

If it breaks the rules in any way then it can NOT be posted...
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

ossama

hi Jackal, what do you think about your code?
can you post it ?

ossama

in this topic:
http://www.masm32.com/board/index.php?topic=8438.0
we were talking about concatenation files to executable file.
i can concatenate 3 files to the executable like this:

copy /b MyApplication.exe+File1+File2+File3 MyApplicationWithData.exe

the question is,how can i know the offsets of file1,file2 and file3 in my application so i can extract them?
thank you.

P1

I am a bit curious.

If your files are in memory, you are in control of them.  i.e.  You can program to replace them.  So it seems to me, we are not talking about your app files in memory from an re-install.  So what is implied here is from an installation point of view, what OS files are we talking about? 

So which files are you looking to update in memory across several OS versions?

Regards,  P1   :8)


Jackal

He is talking about creating a install wizard for his own applications as i take it. I did this because i did not like creating a 60kb app and then creating a 300kb installer because of the uninstall app and the install app. I created like a 6kb uninstall app and a 40kb install app. With compression my setups are very small.

As to the offset problem, you will need to create something like a header. Either before all the files or after the files are written to the end of your setup app you will need to write a list. I would do like 4 bytes(size of filename in hex), Filename(unknown size but get it from last 4 bytes), Offset to file, Length of file. Then you to extract you can get the position of this header and begin reading though it to extract your files. If you were using this for smaller files like i did then i would say using the resources is a lot less work and seems to work just fine. Using this for files in the GB range i would probably go with cab files and create an extractor for those. Also before i forget again you will probably want to write how many files there are in the setup app someplace. This will make it a lot easier to extract them. Another way would be to place the header at the end and then loop through until you got the end of the file but i would recommend the first way.

ossama

hi jackal,your help is very valuable  :U
i was thinking about using headers in my setup application and i was thinking to put that header (or many headers ,one for each file) at the end of my application setup,but i do not know how to get the offset of that header (the first header) in my application. would you give me a simple source code to show that .
thank you.

ossama

yes jackal, you are right,
my programs are less then 100kb (i like asm  :U),and when i use a setup manager like "install sheild "it will create a setup program about 2 MB,this is why i am trying to write a setup program in masm

BogdanOntanu

Installers add 30-40K max to your application...
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

ossama

Quote from: BogdanOntanu on January 16, 2008, 07:37:54 PM
Installers add 30-40K max to your application...
i have an application of size==7kb and "install shield for microsoft vc++" created a setup of size  about 700 kb.
this is bad .

Jackal

i use to use inno setup.. its size was well over 40k larger than my app..

ossama

Quote from: Jackal on January 16, 2008, 09:48:20 PM
i use to use inno setup.. its size was well over 40k larger than my app..
downloading ...

ossama

i have the idea : concatenate files to the end of the instaler executable using COPY (command of dos) and in my instaler program i calculate the offset of the first file then it extracts it to a known location.
the problem how can i get that offset?
what about using PE format to detect/calculate the offset of the end of the installer? is it possible to do this?