• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Making an installer?

One thing I'm struggling with is getting a messagebox to appear after the license page, before in instdir page.

It's a very powerfool tool!

I can't find out how to change the installer .exe thumbnail, nor the logo in the installer (old style).

And I can't seem to get a messagebox to appear before the Page instfiles!
 
I solved the messagebox issue by having it as a

Function MyCustomPage
# If you need to skip the page depending on a condition, call Abort.
MessageBox MB_OK "Message Here"
FunctionEnd

And putting the

Page MyCustomPage


In the right order
 
I can't find out how to change the installer .exe thumbnail, nor the logo in the installer (old style).
I created a small (64x64 pix) icon bitmap (milviz_install.ico) in the C:\Program Files (x86)\NSIS\Contrib\Graphics\Icons folder.

milviz_install copy.jpg


I then edited the nsisconf.nsh file located here: C:\Program Files (x86)\NSIS to specify loading my custom .ico file:
Code:
!define MUI_INSERT_NSISCONF
!macro MUI_NSISCONF
  ;Example: Change the default Modern UI icons
 
  !ifndef MUI_ICON & MUI_UNICON
  !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\milviz_install.ico"
  !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-uninstall.ico"
  !endif
 
!macroend
 
Oh I see. I thought it was compiled into the installer.
Well, it is compiled into the installer. It's just not an obvious way to accomplish the task. It took me several HOURS of digging deep to figure it out. :yikes:

It may well be that there's an alternate way it could be done by including the directive in one's script, I've just not spent any further time on the matter.
 
Oh I see what you mean. Strange, it reads the license from the same directory the nsi file is being compiled from.
 
Oh I see what you mean. Strange, it reads the license from the same directory the nsi file is being compiled from.
That's not a surprise, since we are telling NSIS to look in the same folder as the .nsi file is located. Or, to be more accurate we are not telling it to look anywhere else!
Code:
PageEx license
  LicenseData F4_PhantomII_License.txt
  LicenseForceSelection checkbox
PageExEnd
We have defined no path information for "LicenseData", so it defaults to the current folder. If we had the license text file located somewhere else, we'd simply put in the full "driveletter:\path\filename".

More to the point for this question though, the icon is loaded into the installer's framework before any of our script beguns to be read. In other words, it is handled at a much lower level in the process.

There are two pre-defined UI types: Modern UI and Modern UI 2. I use the latter, in which case the icon is defined and named as I wrote previously. If you are using the Modern UI, then the icon is defined and named in the System.nsh file located in the ..\Contrib\Modern UI folder.
Code:
  !insertmacro MUI_DEFAULT MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
  !insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
 
Last edited:
Ah I see. How do you go about making/ installing your .dlls. I assume that's to do with the DRM? What do you use for that?
 
Ah I see. How do you go about making/ installing your .dlls. I assume that's to do with the DRM? What do you use for that?
I'm not sure what you are asking, as nothing I've written about has anything to do with either .dll files or DRM.

The only two things I've discussed are the little icon image that appears next to the .exe file when seen in Windows Explorer, and also appears in the installer's GUI...

...and the "License.txt" file that is displayed during the installation to which the user has to "Accept..."

NSIS_InstallerVersion_icon.jpg
 
Sorry, I noticed in your script that you installed .dlls. I recall Umberto mentioning that his scenery & gsx installs with .dlls now, to stop piracy. I guess that's another discussion however.
 
Sorry, I noticed in your script that you installed .dlls. I recall Umberto mentioning that his scenery & gsx installs with .dlls now, to stop piracy. I guess that's another discussion however.
Oh, well yes I do occasionally have to install .dll files. However, .gau files are actually .dll files with a funny extension, .dll files on the other hand are often not gauge files as well.
 
…and now for something completely different…

I use the Inno application Very easy to use. An "Wizard" takes care of the basics to include installed file locations - I install planes, effects, missions, and even scenery - with "choose main FSX directory", EULA and registration pages. What the wizard cannot do can usually be taken by a few Pascal commands (examples provided and an extensive help file - I didn't know any Pascal when I started). It is also free.

You can evidently use different languages too - haven't tried that one.
 
I've taken a look at Inno in the past, but honestly cannot see that it is any better than NSIS, or at least not enough to abandon NSIS for something new to learn... :stirthepo

I do notice that there is a really nice (but somewhat expensive to license) Graphical Wizard that will work with either NSIS or Inno.

Today I discovered an even easier way to define and use a custom .icon bitmap for the installer. Simply add this line into the installer script:
Code:
; MUI Settings
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\milviz_install.ico"
One could use any absolute path to the icon file of course.

Also, an even easier way to have a "License Page":
Code:
; License page
!insertmacro MUI_PAGE_LICENSE "..\A_Template Folder\MD530_license.txt"
 
Ah, the marvelous power of !define (s):
Code:
!define PRODUCT_NAME "Milviz F-100D"
!define PRODUCT_VERSION "v1.150828"
!define MILVIZ_ICON "F:\Installer Build Folders\milviz_install.ico"
!define MILVIZ_HEADER "F:\Installer Build Folders\top_banner.bmp"
!define MILVIZ_WELCOME "F-100D_side_banner.bmp"
!define MILVIZ_LICENSE "F-100D_License.txt"
 
!define PRODUCT_PUBLISHER "Military Visualizations"
!define PRODUCT_WEB_SITE "http://www.MilViz.com"
 
SetCompressor lzma
;--------------------------------
;Include Modern UI
 
  !include "MUI2.nsh"
  !include LogicLib.nsh
  !include nsDialogs.nsh
 
;--------------------------------
;General
 
  ;Name and file
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME} ${PRODUCT_VERSION}.exe"

Note that both the Name and OutFile make use of the !define(s) made at the top. Sure saves time and effort!
 
Back
Top