Archive: Built an installer, some questions remain


Built an installer, some questions remain
I'm an experienced (25 years) software engineer, but most of my development and deployements have been unix or linux based. I'm currently developing an open source java-based system. I have previously tested that the system runs under Windows. Some people requested a Windows installer rather than the zip file I had previously used to package for Windows. I looked around, and NSIS seemed the best system to use to build an installer. It works reasonably well. I was able to build a decent installer without asking any questions.

I used the Modern UI. It seemed easier to configure than the other approaches I tried. The installer is visible at http://svn.sourceforge.net/viewvc/*c...i?revision=375

Some comments and observations first, then some questions:

My code is released as open-source, so I didn't force people to "accept" the license. This was easy to do.

I wanted to display some instructions before prompting for configuration information, and the best approach I could find was to re-use the MUI_PAGE_LICENSE macro from Modern UI. (If you look in the installer.nsi file above, you'll see that I've copied and edited that macro.) This allows me to insert a file that the user can scroll through. I needed to change the header and top text (since my new page wasn't a license), and the standard macro didn't seem to allow this. Is there a better way to do this?

After displaying the instructions, I prompt for configuration parameters, verify the values, and substitute the values into a config file. ConfigRead and ConfigWrite worked quite well for this. (I verify that two parameters are numeric, and insist that the password that is entered isn't the default one that ships with the system.) Feel free to adapt this example for others to use if it looks like my approach was reasonable.


There are a few issues that it would be nice to clean up if anyone can suggest changes I might make.

QUESTION 1: I made a 150x57 BMP files from a .png file for the header image. It displays pretty nicely using the previewer, but NSIS does something ugly with it. Any suggestions?

The BMP I feed to NSIS is http://svn.sourceforge.net/viewvc/*c...ogo.zocalo.BMP The result looks like the attached image.

QUESTION 2: I used dialogs::InputBox, but couldn't figure out how to wrap long lines (\r\n didn't work). If my lines are longer than a certain length, parts are hidden under the buttons.


Hmmm. Well, that bmp isn't 150x57, it's a little bigger, since that was the best display I could generate. I don't see a 150x57 copy of the image now, but it had worse jaggies. any advice on optimising display of a BMP as header image?


any advice on optimising display of a BMP as header image?
I have found that using the 150 x 57 pixel size recommended in the MUI Readme gives the best results. Here is how I made the header image used in the attached screenshot. (I used the free IrfanView program but other graphics programs have similar capabilities)

(1) Open a copy of the original 200 x 64 pixel logo

(2) Reduce the image width to 150 pixels while maintaining the aspect ratio.

(3) The resized image was 150 x 48 pixels (i.e. it is not high enough)

(4) Resize the canvas by adding a white border with left size width 0 pixels, right size width 0 pixels, top size width 4 pixels, bottom size width 5 pixels.

(5) The resized image is now 150 x 57 (the recommended size) so it was saved.

The attached screenshot shows part of a MUI license page created using the 150 x 57 version of the logo.

Originally posted by pengyou
(3) The resized image was 150 x 48 pixels (i.e. it is not high enough)
And 5 minutes with MS paint you can fill the 9 pixel gap to the match with the background. :)

Sorry I botched the question about the icon. I started with this (150x57) image. (continued in next comment)


When I ran NSIS, the image displayed, looked like this image. Notice the jaggies? Why doesn't the image display better? I'll try the 150x57 images that were offered, but I know how to build my own. (I cropped and added a white vertical border in order to get to 150x57.)

Thanks for any help.


Bizarre! I tried the image trueparuex offered, and it worked fine. It's 150x57, just like the one I posted a little while ago as logo.zocalo-c.bmp. His is about a third the size of mine. Anyone know what I did wrong in editing the bitmap? Why does his produce a better installer logo than mine, when they're both 150x57, and look the same to my eye? For now, I'll use trueparuex's image. Thanks!