• 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.

addon setup wizard

Messages
118
Country
israel
hi...

do you know good setup wizard to build addons setup for FSX ?

what I need is:
* auto detect FSX root folder
* backup some fsx folders
* copy scenery or aircraft files to destination folders
* add lines to scenery.cfg
* can be uninstalled and restore backups

thanks, tomer
 
Most better installers (usually commercial - e.g. Install Shield) can do any of these. You could probably also find some opensource installer project, that might be a bit more difficult though.

Or - if you expect to publish a payware project - you can approach a publisher and ask them about making the installer for you, e.g. Aerosoft.
 
If you want something absolutely free and Open Source, then I can't recommend NSIS (Nullsoft Scriptable Installer System) highly enough!

http://nsis.sourceforge.net/Main_Page

Amazingly, NSIS is used by many of the most famous publishers, including Adobe, Dropbox, Google, McAfee, and Yahoo!

http://nsis.sourceforge.net/Users

The scripting language used is very flexible and powerful. For example, to determine the SetupPath for which simulator version, this is all you need:
Code:
        ${If} $RadioButton1_State == 1
              ReadRegStr $INSTDIR HKLM "Software\Microsoft\Microsoft Games\flight simulator\10.0" SetupPath
	${EndIf}

        ${If} $RadioButton2_State == 1
              ReadRegStr $INSTDIR HKLM "Software\LockheedMartin\Prepar3D" SetupPath
        ${EndIf}
        
        ${If} $RadioButton2a_State == 1
              ReadRegStr $INSTDIR HKLM "Software\LockheedMartin\Prepar3D v2" SetupPath
        ${EndIf}

To completely uninstall a specific aircraft, using the recursion flag (/r) makes it a simple two line command:
Code:
  SetOutPath "$INSTDIR\SimObjects\Airplanes"
  RMDir /r "$INSTDIR\SimObjects\Airplanes\Milviz Boeing 737-200"
The first line sets the path to the parent folder.
The second line will recursively delete all files and sub-folders, then finally delete the folder specified in the command. In this case that would be the ..\Milviz Boeing 737-200 folder.
 
I'm another big fan of NSIS, but whether you'd find it useful really depends on how confident you are with scripting. I am not a programmer, so it is mostly a learning experience for me, but if you have programmed before, it would be a doddle.

This week I've finally got around to adding dual-install (FSX/P3D2) to my script. Not the most elegant of scripts, but it does do what I want. Most of the work goes into error checking, so that you don't accidentally mess up someone's sim.

...which for someone with my lack of skills, means no recursive rmdirs just in case:)
 
This week I've finally got around to adding dual-install (FSX/P3D2) to my script. Not the most elegant of scripts, but it does do what I want. Most of the work goes into error checking, so that you don't accidentally mess up someone's sim.

...which for someone with my lack of skills, means no recursive rmdirs just in case:)

There is a truly excellent support form for NSIS here: http://forums.winamp.com/forumdisplay.php?f=65

The one thing that's unique in my installer script is that I do not use any of the 'generic' methods to create a separate "uninstall.exe" program. Instead, the "Uninstall" routine is built into the installer as a selectable option.

This allows me to specify precisely what will be removed, since every installation from Eaglesoft or Milviz includes some "common files and/or .dll files" that should never be removed during an uninstall.

The nicest part of NSIS is that you can script your menu and choices and compile/run quickly without actually including any of the files. Also, once you're happy with the basic format, you can simply save it as a "template" from which to then quickly set up a custom installer for any projects.

Here is the working UI for the newest release of the 737-200 project. Note that there are three install options: FSX, P3D v1 and P3D v2, as well as options for texture resolution and three types of lighting! :wizard:
 

Attachments

  • NewInstallerMenu.png
    NewInstallerMenu.png
    49.5 KB · Views: 540
That's a brilliant idea, Bill. I won't hijack this thread, but this has given me a few ideas to be going on with.
 
Sorry to bump an old thread, I'm needing to port over to NSIS and get started. Right now my installers don't have support for P3D scenery.cfg additions, and am wondering if anyone knows of an opensource code to be able to add the scenery folder entries to the scenery.cfg files. My current program (a friend coded for me) only supports FSX and people are asking me for a P3D option in the installers.
 
Here's the code I use, I wrote it myself, based on sample code from NSIS, you can use it if you wish. I'm definitely not a coder, but this has worked without issue for a lot of my installers.

These are the includes:

Code:
!include "MUI.nsh"
!include "LogicLib.nsh"
!include "nsDialogs.nsh"

The .Oninit function locates FSX and/or P3D;

Code:
Function .OnInit
         StrCpy $FSXexists 0
         StrCpy $P3Dexists 0

  ClearErrors

    ReadRegStr $FSXpath HKLM "Software\Microsoft\Microsoft Games\Flight Simulator\10.0" "SetupPath"

    IfErrors NoFSX
    StrCpy $FSXexists 1
        NoFSX:
    ClearErrors
    ReadRegStr $P3Dpath HKLM "SOFTWARE\Lockheed Martin\Prepar3D V2" "SetupPath"
    IfErrors NoP3D
    StrCpy $P3Dexists 1
    NoP3D:
        ${If} $FSXexists == 0
        ${AndIf} $P3Dexists == 0

    MessageBox MB_OK "Unable to find FSX or Prepar3D v2 install path in System Registry. The installer is not able to proceed with the installation. Please refer to the installation manual."
    Abort

    ${EndIf}
FunctionEnd

This builds the custom dialog page:

Code:
; dialog create function
Function fnc_Chooser_Create

  ; === Chooser (type: Dialog) ===
  nsDialogs::Create 1018
  Pop $hCtl_Chooser
  ${If} $hCtl_Chooser == error
    Abort
  ${EndIf}
  !insertmacro MUI_HEADER_TEXT "Simulator Chooser" "The installer has found the following compatible simulators:"

  ; === RadioButton1 (type: RadioButton) ===
  ${If} $FSXexists == 1
  ${NSD_CreateRadioButton} 157 74 147 24 "Microsoft Flight Simulator X"


   Pop $hCtl_Chooser_RadioButton1

     ${NSD_Check} $hCtl_Chooser_RadioButton1
   ${Endif}

  ; === RadioButton2 (type: RadioButton) ===
    ${If} $P3Dexists == 1
  ${NSD_CreateRadioButton} 157 92 166 25 "Lockheed Martin Prepar3D v2"
  Pop $hCtl_Chooser_RadioButton2
      ${If} $FSXexists == 0
       ${NSD_Check} $hCtl_Chooser_RadioButton2
       ${EndIf}
   ${Endif}

    ; === Label1 (type: Label) ===
  ${NSD_CreateLabel} 71 29 328 42 "This installer can install to Flight Simulator X, or Prepar3D v2. Installed simulators are shown here. If you have both installed, you must choose the simulator you wish to install to."
  Pop $hCtl_Chooser_Label1


  ; === Label2 (type: Label) ===
  ${NSD_CreateLabel} 71 154 286 42 "If you wish to install to both simulators, you need to run the installer twice."
  Pop $hCtl_Chooser_Label2


FunctionEnd

...and this displays it:

Code:
; dialog show function
Function fnc_Chooser_Show
  Call fnc_Chooser_Create

  nsDialogs::Show $hCtl_Chooser


FunctionEnd

When the user selects something, some variables are set up depending on the sim;

Code:
Function nsDialogsPageLeave

${NSD_GetState} $hCtl_Chooser_RadioButton1 $FSXstate
${NSD_GetState} $hCtl_Chooser_RadioButton2 $P3Dstate

SetShellVarContext all
${If} $FSXstate == ${BST_CHECKED}
StrCpy $SIM_PRODUCT_NAME "${PRODUCT_NAME} FSX"
StrCpy $SIM_CONFIG_PATH "$APPDATA\Microsoft\FSX\"
StrCpy $SIMchoice "FSX"
ReadRegStr $INSTDIR HKLM "Software\Microsoft\Microsoft Games\Flight Simulator\10.0" "SetupPath"
${ElseIf} $P3Dstate == ${BST_CHECKED}
StrCpy $SIM_PRODUCT_NAME "${PRODUCT_NAME} P3D"
StrCpy $SIM_CONFIG_PATH "$APPDATA\Lockheed Martin\Prepar3D v2\"
StrCpy $SIMchoice "P3D"
ReadRegStr $INSTDIR HKLM "Software\Lockheed Martin\Prepar3D v2" "SetupPath"
${EndIf}


ClearErrors

  FunctionEnd


This is called between the Welcome page and EULA page:

Code:
!insertmacro MUI_PAGE_WELCOME

Page custom fnc_Chooser_Show nsDialogsPageLeave

!insertmacro MUI_PAGE_LICENSE "I:\Users\Robin\Documents\Olddocuments\eulaSubscription.txt"

Hopefully the variables used should be self-evident. Then it's just a matter of using the resulting pointers to the install location, and the Scenery.cfg file.
 
Back
Top