Skip to content
⌘ NSIS Forum Archive

Visual Studio Style Installer

9 posts

Muby#

Visual Studio Style Installer

Hi,

I'm looking a way to make an installer like visual studio

I didn't find anything on web regarding a way to create my custom plugin to do it.

Does anyone have a idea ?

Thanks
Anders#
Edit ${NSISDIR}\Contrib\UIs\modern.exe with Resource Hacker and apply with MUI_UI/ChangeUI. This will only change the UI layout. You can use SetCtlColor to change control colors but you are never going to get exactly what you have in that screenshot because that is probably a custom MSI UI.
Nutzzz#
I use UltraModernUI for NSIS, which leverages the SkinnedControls plugin, and made a modern flat look UI, with custom buttons and scrollbars etc. But it was quite a bit of work to skin almost everything (message boxes still aren't skinned).

There's also Graphical Installer,
and SkinCrafter (the latter has issues with 2.46+, apparently).

None are perfect. If you use plugins to generate any content, you'll need to use SetCtlColors.

I'd show you a screenshot, but it's made for a third party.
sfx09#
It's MSI-based UI - 'Surface'. Very cool, but not free. I hope it will be in NSIS in the future, or more kewl GUI. 🙂

Get inspiration for your installer projects by browsing through the Advanced Installer Gallery.
T.Slappy#
Graphical Installer

Originally Posted by Nutzzz View Post
There's also Graphical Installer,
and SkinCrafter (the latter has issues with 2.46+, apparently).
This exact feature (creating Visual Studio like installers) was implemented in Graphical Installer some time ago.





Check this link for more info: http://graphical-installer.com/jooml...ws/153-news-39
Muby#
Hi,

thanks all for replying.

I a look a little bit on GraphicalInstaller, but it's still a commercial product.

I was looking for a opensource or free method.


I will look on ultraModern to test what's Nutzzz tell me.


Is there some tutorial to make my own "ultraModern", "ModernUi" ?

Thanks
Nutzzz#
No tutorials that I know of, but here's a quick and dirty one to get you started:

After you install UMUI, make a copy of one of the skin .nsh files in C:\Program Files (x86)\NSIS\Contrib\UltraModernUI\Skins and copy the corresponding folder of images, and move them to your installer folder. Grab Paint.NET or Gimp and change the buttons and scrollbars to a flat color, and use a slightly different color as a border. Take a screenshot of one you want to duplicate and use the eyedropper tool to get the exact color if you want. Don't bother making the background/header/bottom, etc. a single color; you can just disable those. If you use the components page, you probably want to make new checkboxes too. Copy and edit one of the ones from C:\Program Files (x86)\NSIS\Contrib\Graphics\Checks, and specify the new image with MUI_COMPONENTSPAGE_CHECKBITMAP.

!import the skin's .nsh file into your installer, and tweak it to remove the images you don't want and to change the paths to your new versions, tweak the colors as necessary. I'd suggest specifying the following in the .nsh:
!define MUI_COMPONENTSPAGE_SMALLDESC
!define UMUI_NOLEFTIMAGE
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define UMUI_USE_ALTERNATE_PAGE
!define UMUI_USE_UNALTERNATE_PAGE
Note that some defines start with UMUI_ for UltraModern as they're UMUI only, others with MUI_ as they're shared with Modern UI 2.

Check out the examples in C:\Program Files (x86)\NSIS\Examples\UltraModernUI (there are some new pages you can play with for a more modern feel, though they mostly duplicate InstallShield behavior).

The readme is great, but very dense as there are tons of options (hit Expand All at the top if you want to do searches): C:\Program Files (x86)\NSIS\Docs\UltraModernUI\Readme.html
Coby#
I recently discovered this configuration for NSIS

Name "Setup"
OutFile "Setup.exe"
InstallDir "$PROGRAMFILES\Setup"
SetCompressor /SOLID /FINAL lzma
!include "MUI2.nsh"
!include "WinCore.nsh"
!include "LogicLib.nsh"
!include "WinMessages.nsh"
!include "FileFunc.nsh"
RequestExecutionLevel Admin
ShowInstDetails hide
ShowInstDetails nevershow
ShowUnInstDetails nevershow
XPStyle off
BrandingText /TRIMRIGHT " "
Icon "Icons\appicon.ico"
!define MUI_ICON "Icons\appicon.ico"
!define MUI_UNICON "Icons\Uninstall.ico"
UninstallIcon "Icons\Uninstall.ico"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "PageWelcome" 
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "un.ModifyUnConfirm" 
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Function ".onInit"
  InitPluginsDir
  SetOverwrite try
  AllowSkipFiles off
  File "/ONAME=$PLUGINSDIR\DuiLib.dll" "Install\DuiLib.dll"
  File "/oname=$PLUGINSDIR\inst.ui" "Install\inst.ui"
  File "/ONAME=$PLUGINSDIR\installer-helper.dll" "Install\installer-helper.dll"
  IfSilent +2 0
  Push install
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD InitUI
  IfAbort 0 +2
  Abort
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD SetInstDir
  IfAbort 0 +2
  Abort
FunctionEnd
Function "PageWelcome"
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD ShowUI
  IfAbort 0 +2
  Abort
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD GetUIControlCode
  IfAbort 0 +2
  Abort
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD GetInstDir
  IfAbort 0 +2
  Abort
  Push 1
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD SetNSISControlCode
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD GetUIControlCode
FunctionEnd
Section ""
  ClearErrors
  SetShellVarContext "all"
  SetOutPath "$INSTDIR"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Setup" "DisplayName" "Setup"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Setup" "UninstallString" "$INSTDIR\uninst.exe"
  WriteUninstaller "$INSTDIR\uninst.exe"
  SetAutoClose True
SectionEnd
Function ".onGUIEnd"
  SetOutPath $PLUGINSDIR
FunctionEnd
Function "un.onInit"
  InitPluginsDir
  SetOverwrite try
  AllowSkipFiles off
  File "/ONAME=$PLUGINSDIR\DuiLib.dll" "Uninstall\DuiLib.dll"
  File "/oname=$PLUGINSDIR\inst.ui" "Uninstall\inst.ui"
  File "/ONAME=$PLUGINSDIR\installer-helper.dll" "Uninstall\installer-helper.dll"
  SetShellVarContext all
  IfSilent +2 0
  Push uninstall
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD InitUI
  IfAbort 0 +2
  Abort
FunctionEnd
Function "un.ModifyUnConfirm"
  IfSilent 0 +2
  Quit
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD ShowUI
  IfAbort 0 +2
  Abort
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD GetUIControlCode
  IfAbort 0 +2
  Abort
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD GetInstDir
  IfAbort 0 +2
  Abort
  Push 1
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD SetNSISControlCode
  CallInstDLL $PLUGINSDIR\installer-helper.dll /NOUNLOAD GetUIControlCode
FunctionEnd
Section "Uninstall"
  ClearErrors
  SetShellVarContext "all"
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Setup"
  SetShellVarContext "all"
  RMDir /r "$INSTDIR"
  SetAutoClose true
SectionEnd
Function "Un.onGUIEnd"
  SetOutPath $PLUGINSDIR
FunctionEnd