Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 8th July 2002, 17:49   #1
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Lightbulb Full color icon, XP style without recompiling and smaller header size

I have worked on this for quite a while now, but it is finally ready

This is a modification of NSIS 1.98.

I have added:

* Ability to add XP manifest without recompiling (XPStyle on)
* Support for all types of icons. Uninstall icon shuold still be the same structure as the installer icon, if used. You can even add an icon with 3 different sizes in it (this mod's installer includes one with 9).
* Stripping of unused resources from the exe header. For example, if you didn't use the license page, the license dialog resource will be stripped down resulting in an even smaller exe header.
* ${NSISDIR} - A constant holding the path in which NSIS is installed, on the compiler machine of course...

I am suggesting this mod as NSIS 1.99.

Sunjammer kindly helped me by hosting the file on his NSIS archive.

You can download it from:
http://www.clantpa.co.uk/nsis/wiki/index.php/Nsis199

I hope you enjoy it
KiCHiK

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th July 2002, 18:41   #2
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Does XPStyle on work when you have CRC check on?
rainwater is offline   Reply With Quote
Old 8th July 2002, 19:06   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Yes, all of the above work with CRC check on.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th July 2002, 23:20   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,354
Question

but i cant use this with nsis 2.0 alpha?
Yathosho is offline   Reply With Quote
Old 8th July 2002, 23:25   #5
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,354
${NSISDIR} is nice, thank you!

about my previously posted question. i'm really hot for the fullcolor icons, but i just modified my code for some new features of 2.0 alpha. maybe there could be a new alpha with your features beside the 1.99 ?
Yathosho is offline   Reply With Quote
Old 9th July 2002, 01:14   #6
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
If you let me know which files you changed for each new feature, I will try to incorporate them into 2.0a.
rainwater is offline   Reply With Quote
Old 9th July 2002, 02:38   #7
spanky
Senior Member
 
Join Date: May 2000
Posts: 295
Send a message via ICQ to spanky
kichik,
Using your mod I get an error using InstallColors. It worked with NSIS 1.98 but it doesn't work with yours.

I'm using:
InstallColors 0066C8 000000

From MakeNSISW:
"InstallColors: fg=0066C8 bg=000000
Usage: InstallColors (/windows | (foreground_color background_color))
Error in script "poop.nsi" on line 86 -- aborting creation process"

Any knowledge as to why this occurs?

all work and no play makes jack a dull boy
spanky is offline   Reply With Quote
Old 9th July 2002, 07:54   #8
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Keep me posted about whether or not this *is* a bug, if it is I'll list it as a known bug on the info page about this mod.
Sunjammer is offline   Reply With Quote
Old 9th July 2002, 08:07   #9
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Rainwater said:
Quote:
If you let me know which files you changed for each new feature, I will try to incorporate them into 2.0a.
1.98 -> KiCHiK 1.99 diffs attached (placed here so anyone who cares can see). The zip contains a text file listing the changed files plus the diffs of the changed files, I haven't had time to strip out the unchanged code so the diff files are complete files if you see what I mean.
Attached Files
File Type: zip 198199diffs.zip (91.5 KB, 241 views)
Sunjammer is offline   Reply With Quote
Old 9th July 2002, 08:43   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Thanks spanky,

It was indeed a bug, and a very stupid one may I add...
I have fixed this bug and another one relating the default uninstall icon. I have also updated the makefiles (I hope I did it right...).

I hope the new file will be up soon on Sunjammer's NSIS Archive. I will let you know when it is there.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th July 2002, 08:52   #11
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
The archive has now been updated with the new version of KiCHiK's 1.99 NSIS mod.
Sunjammer is offline   Reply With Quote
Old 9th July 2002, 11:03   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Sunjammer, you forgot the core of it all in the diffs zip you posted earlier. You forgot ResourceEditor.cpp and ResourceEditor.h.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th July 2002, 11:24   #13
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Ahha of course that would be because I posted differences and forgot additions, twit. Well you've pointed it out now, can't believe I forgot to mention that!
Sunjammer is offline   Reply With Quote
Old 9th July 2002, 15:44   #14
CodeSquid
Member
 
Join Date: Dec 2001
Posts: 89
Compile error with !packhdr

I'm using the packhdr command to further reduce the size of the installer. I'm using the latest version of UPX for exe compression.

But everytime I use !packhdr in my scripts, NSIS 1.99 always reports this error message:
"Locating install icon after compress: find_data_offset: error searching data -- failing!"
CodeSquid is offline   Reply With Quote
Old 9th July 2002, 16:48   #15
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Re: Compile error with !packhdr

Quote:
Originally posted by CodeSquid
I'm using the packhdr command to further reduce the size of the installer. I'm using the latest version of UPX for exe compression.

But everytime I use !packhdr in my scripts, NSIS 1.99 always reports this error message:
"Locating install icon after compress: find_data_offset: error searching data -- failing!"
It sounds like there could be a problem with the patch that is stripping the unused resources. Maybe people should use upx to take care of that?
rainwater is offline   Reply With Quote
Old 9th July 2002, 17:43   #16
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
My patch doesn't ever remove the icon. I don't see any reason for it to fail. The icon is there. Did this work with NSIS 1.98? Maybe UPX compresses the icons as well. But then, how could Windows read them?

Please send me the script so I can look further into it.

EDIT:
I think I know what is wrong. Maybe UPX compress all of the icon resource together, and doesn't align each raw data section size to 8 like my resource editor does.

I will look into it, and if this is the case I will just rewrite the find_data_offset function to match this case.

Does it only happen when you add an icon file with more than one icon?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th July 2002, 18:01   #17
CodeSquid
Member
 
Join Date: Dec 2001
Posts: 89
Yes, it worked before with 1.98
When I call upx with --compress-icons=0 1.99 still doesn't work

EDIT:
My icon files have more than one icon: 32x32 and 16x16, each in 16 and 256 colors
CodeSquid is offline   Reply With Quote
Old 9th July 2002, 18:11   #18
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
OK, so that must be the problem... UPX eliminates the space between icons... I will fix this bug tomorrow.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th July 2002, 20:35   #19
spanky
Senior Member
 
Join Date: May 2000
Posts: 295
Send a message via ICQ to spanky
Normally, compressing the icons is not a good idea.
Use this instead:
!packhdr tmp.dat "upx --best --crp-ms=500000 --color --compress-icons=0 tmp.dat

all work and no play makes jack a dull boy
spanky is offline   Reply With Quote
Old 10th July 2002, 15:36   #20
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I have found out what the problem is, and it is a pretty funny one
It seems UPX doesn't eliminate the space between icons, it adds more! Some compression eh?

I won't make the fix today, maybe tomorrow. If anyone else wants to do it instead of me here is my idea (if you have a better one please post it):
The uninstaller icon data should be saved as an array of variable length entries. Each entry of the array would contain:
1) The size of the icon
2) The offset in which it should saved
3) The icon data itself

generate_uninstall_icon_data would build this array and leave the offsets entries empty. After the file is compressed using UPX or whatever (which is the last the time the exe header can change) the offsets will be written into this array. To find the offsets you will have to write a function like get_addr_of_res.

The function generating the uninstaller must change too (in the exe header).

If all this is done it would be useless for get_addr_of_res to search for the icon offset, and to be called after each use of CResrouceEditor.

If someone is ready to this please tell me. If I get no PMs/E-Mail until tomorrow I will do it my self.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 10th July 2002, 19:40   #21
pjw62
Senior Member
 
Join Date: Aug 2001
Posts: 108
I haven't seen your code yet, but it sounds a bit special sir.

You are a good programmer (or I am extraordinarily poor) and I must admit, I had a go at it and could not get it working very cleanly. Eventually I had to settle with not being able to add named entries, 'cause I just couldn't get them to work.

I am downloading yours now and will take a quick peep

Thanks/
pjw62 is offline   Reply With Quote
Old 11th July 2002, 10:05   #22
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Thanks pjw62

If you need some resources of the resource section strcture PM me, I have stumbled ascross some while studying the subject

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th July 2002, 17:47   #23
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
OK, it is ready!
InstallColors, UPX, multiple icons, zlib and bz2. It all works now. This time I wrote the icons handling functions a bit more general so it should be able to handle even the craziest compiler/packer unless it compresses the icons (I hope ).

I have also added an error message if the NSIS path could not be found in the registry. It does not stop compilation, but I at least now you will know why your include doesn't work.

I have asked Sunjammer to upload the new file. He'll let you know when it is there.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th July 2002, 18:06   #24
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Uploaded

KiCHiK's new version has been uploaded. The direct link to the file is http://www.clantpa.co.uk/nsis/hosted/nsis199.exe.
Sunjammer is offline   Reply With Quote
Old 11th July 2002, 18:10   #25
rainwater
Senior Member
 
Join Date: Aug 2000
Posts: 397
Send a message via ICQ to rainwater
Quote:
Originally posted by kichik
I have also added an error message if the NSIS path could not be found in the registry. It does not stop compilation, but I at least now you will know why your include doesn't work.
That is not needed. You don't need to read from the registry to get the directory. Just change that code in build.cpp to this:

code:

{
char szNSISDir[NSIS_MAX_STRLEN],*fn2;
GetModuleFileName(NULL,szNSISDir,sizeof(szNSISDir));
fn2=strrchr(szNSISDir,'\\');
if(fn2!=NULL) *fn2=0;
definedlist.add("NSISDIR", (char*)szNSISDir);
}

rainwater is offline   Reply With Quote
Old 11th July 2002, 18:23   #26
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Thanks Rainwater, it is indeed better. Done.

EDIT: Uploaded

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 12th July 2002, 15:03   #27
mlbl
Junior Member
 
Join Date: Jul 2002
Posts: 42
I think that the stuff that you stripped down causes a problem with having a custom Enabled/Disabled bitmap for the checkboxes/option boxes.

It worked fine in 1.98 but this feature was broken in your copy, hope you can fix it ASAP. Other than that everything else works fine.
mlbl is offline   Reply With Quote
Old 12th July 2002, 15:22   #28
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Err... I can't beleive I did that stupid mistake again! I forgot to call get_addr_of_resource after altering rsources...
A new version will be uploaded ASAP.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 14th July 2002, 19:25   #29
T(+)rget
Junior Member
 
Join Date: Jul 2002
Posts: 7
I was wondering whether or not u could add that Brand Image thingy to your version of NSIS as well with full like bmp support like with da icons if poss.
T(+)rget is offline   Reply With Quote
Old 14th July 2002, 22:25   #30
T(+)rget
Junior Member
 
Join Date: Jul 2002
Posts: 7
lol soz

Anyway like I said it'll be nice to see that Brand Image thing included with this version of NSIS you know the image on the side of the installer.
T(+)rget is offline   Reply With Quote
Old 15th July 2002, 00:48   #31
mlbl
Junior Member
 
Join Date: Jul 2002
Posts: 42
Quote:
Originally posted by T(+)rget
lol soz

Anyway like I said it'll be nice to see that Brand Image thing included with this version of NSIS you know the image on the side of the installer.
That would probably make the installer look a bit weird. In it's current form, the installer is pretty much simple and small in size. Adding a branding image will also make the installer size much larger and i think NSIS looks great at the moment. If you're looking for an installer that supports branding, try Inno Setup instead - www.jrsoftware.org
mlbl is offline   Reply With Quote
Old 15th July 2002, 20:05   #32
T(+)rget
Junior Member
 
Join Date: Jul 2002
Posts: 7
Yeah but you could do a switch so that if you don't include it in your nsi file it won't use the coding for it or if you put in your nsi file BrandImage off.

I just think it'll be a nice addition to NSIS which most people would like to use say like if the installer is over 50mb or something you wouldn't notice much difference in size.
T(+)rget is offline   Reply With Quote
Old 19th July 2002, 11:21   #33
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Hi Target,

I will do it. I was thinking of doing it with the first version but I had a problem with bitmaps...

To mlbl, I will make it so the header size won't change. Don't worry, it is just a couple of lines of code...

KiCHiK

[edit]I have just noticed that Sunjammer has uploaded the new version with the Enabled/Disabled bitmap bug fixed.

Thanks Sunjammer[/edit]

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Last edited by kichik; 19th July 2002 at 11:57.
kichik is offline   Reply With Quote
Old 19th July 2002, 17:09   #34
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Quote:
I have just noticed that Sunjammer has uploaded the new version with the Enabled/Disabled bitmap bug fixed.
Eh? I haven't done anything recently, what are you on about KiCHiK?

[edit]KiCHiK is correct - if you consider six days ago to be "recently" [/edit]

Last edited by Sunjammer; 19th July 2002 at 17:48.
Sunjammer is offline   Reply With Quote
Old 19th July 2002, 23:09   #35
T(+)rget
Junior Member
 
Join Date: Jul 2002
Posts: 7
lol

Thanks for your reply about adding the Brand Image like that old version which that anyedit guy done NSIS v1.59BB (I did contact him about doing it for the latest version but he ain't got no time to do it)
T(+)rget is offline   Reply With Quote
Old 20th July 2002, 14:46   #36
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
A new version is out:

- Full color bitmap for EnabledBitmap/DisabledBitmap are now supported. Bitmap size MUST be 20x20 now though... I hope that doesn't break anyone's script
- Code now compiles and works with Borland compiler (would somone mind checking it on mingw too?)
- Fixed a bug that caused makensis to crash if uninstall section was present and WriteUninstaller wasn't. Also made it so the uninstaller data won't be added unless WriteUninstaller was called.

For Borland copmiler users:
1) To compile my mod you need to change the current makefile and get it to compile ResourceEditor.cpp too.
2) If you want to make your Borland compiled NSIS even smaller you can remove any resources of the RCData type (using Resource Hacker or another resource editor), and remove the .reloc section (using crayzee's wipe.reloc v1.40 or another aligner/wiper). UPX does a good job as well.

I think that branding image support will take a little longer to make than I have thought in the first place. It is a little complicated... I will try to find some code on the Internet, but if I fail I will have to write it my-self and it will take some time.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 20th July 2002, 15:46   #37
T(+)rget
Junior Member
 
Join Date: Jul 2002
Posts: 7
Here's the download link to the old Brand Image using NSIS v1.59

NSIS Brand Image
T(+)rget is offline   Reply With Quote
Old 20th July 2002, 19:50   #38
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The problem with this mod is that it forces you to use branding image. I don't want to do that. I want to give it as an option.
To do this I need to learn how to edit dialog resources. And of course, like everything else with Microsoft, it isn't that simple...
I haven't found any class/code that already does this so I guess I will have to write my own class. I hope it won't take too long. If I write this class I will be able to implement font changing as well.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 21st July 2002, 14:50   #39
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Uploaded

I was away so KiCHiK's new NSIS 1.99 version has literally only just been uploaded to my archive. Keep it up KiCHiK - that's the sixth version I've uploaded so far
Sunjammer is offline   Reply With Quote
Old 21st July 2002, 20:45   #40
T(+)rget
Junior Member
 
Join Date: Jul 2002
Posts: 7
Yeah do it your way mate so we can change fonts as well that'll be nice. Can't wait for this version to come out!
T(+)rget 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