Old 30th October 2001, 00:04   #1
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Question Compile in Borland

I was wondering if anyone had a makefile to compile NSIS with Borland's free compiler. I found one in the archives but it didnt work to well. Also, it would be nice if makefiles for other compilers were included in the source as well.
rainwater is offline   Reply With Quote
Old 30th October 2001, 04:47   #2
DuaneJeffers
Major Dude
 
DuaneJeffers's Avatar
 
Join Date: May 2001
Location: Winter Park, FL
Posts: 1,776
This was asked awhile ago. umm. I believe we couldn't find one.

sorry.

-Duane

Website

Yeah, that's pretty much it. :-\
DuaneJeffers is offline   Reply With Quote
Old 30th October 2001, 20:21   #3
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
Crikey! Can it be so hard to write one? I wrote one for the exe head and makensis for VC++ 4.0. The hardest part on other compilers is getting the size tweaks right. (i.e. /nowin98, /FD etc).
pjw62 is offline   Reply With Quote
Old 30th October 2001, 21:06   #4
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
The main problem I was having was compiling the resource file in the exehead.

The rc file contains the line:
PHP Code:
#include "afxres.h" 
This is a mfc include so borland doesnt find it. After commenting it out, I get the error:

- Error resource.rc 100 74: Incomplete expression

Any ideas?
_
rainwater is offline   Reply With Quote
Old 4th November 2001, 19:55   #5
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
sounds liek your headers are not up to date..
a quick fix; open resource.rc and add
#define PBS_SMOOTH 0

I dont know the proper value, neither do I care for the 'smoothing'.

I just checked it and it compiles fine with Borlands free compiler.
pjw62 is offline   Reply With Quote
Old 4th November 2001, 20:04   #6
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
now just to get the size optimisations.. 45.5kb on default options, but new simple 'initialisation module' that simply jumps to winmain (equivalical to setting the entry point on the ms compilers).
pjw62 is offline   Reply With Quote
Old 5th November 2001, 11:27   #7
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
Okay. There are a few problems, not with compiling makensis, but with the implementation of finding the icon offset.

When you use the borland resource compiler, it changes offset 14h (if I remember rightly - I am at school now) from 0x00 to 0x80 in the .res file. Obviously when the application is linked, this change is maintained. When however, you bin2h, the data at 14h is _not_ changed. The result is that at the initialisation of the exe build class, memcpy does not return 0 even when the correct icon offset is reached.

solutions

1. (Preferred). Use the structures in winnt.h to load the icon offset from the exe header in memory (I decided it would just be easiest to find the offset of the first bitmap, second bitmap and first icon - so if you do any modifications to the resource script as long as you keep the bitmaps and icon in the right order it should be okay). This will oleviate around 100,000 memcpy calls speeding up the initialisation process alot and will fix the icon problem.
THis can be done quite easily; just cast a pointer of the dos header (struct defined in winnt.h) to the exe header and traverse through the sections until you find 1. the resource directory 2. the bitmap or icon group 3. the first actual icon or bitmaps. In order to get a file offset, remember to consider the RVA(relative virtual address or something).

2. Easy - after bin2h'ing load the header and change the 14h (or whatever it was) offset from 0 to 0x80.
pjw62 is offline   Reply With Quote
Old 5th November 2001, 11:48   #8
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
Another idea I just had would be why not use on the unused fields in the PE header of the exe head to store the size of the exe head. That way on loading the installer, we would not have to cycle through the header in 512 byte increments searching for the NSIS 'neato surprise' thing.

(just a though, would save space and increase speed).
pjw62 is offline   Reply With Quote
Old 5th November 2001, 19:19   #9
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
Nowww.. how do I submit suggestions to Justin?
pjw62 is offline   Reply With Quote
Old 6th November 2001, 19:46   #10
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
Anyway, Rainwater, here are the makefiles I used to compile the header and makensis.

Note; you will still need to define PBS_SMOOTH in resource.[h|rc] (either will do).
Attached Files
File Type: zip makefiles.zip (1.5 KB, 110 views)
pjw62 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump