Contrib/ExperienceUI/XPUI.nsh
changeset 2 ccebbad46f6a
parent 0 d5ce4c64ef88
child 3 b081db857e2f
equal deleted inserted replaced
1:99d4be98d3cc 2:ccebbad46f6a
     1 ; NSIS ExperienceUI User Interface version 1.11
     1 ; NSIS ExperienceUI User Interface version 1.11
     2 ; Macro System and Main Logic
     2 ; Macro System and Main Logic
     3 ; Written by Dan Fuhry
     3 ; Written by Dan Fuhry
     4 
     4 
     5 ; Copyright © 2004-2006 Dan Fuhry
     5 ; Copyright © 2004-2006 Dan Fuhry
     6 ; Portions written by Joost Verburg
     6 ; Portions written by Joost Verburg
     7 ; Copyright © 2002-2004 Joost Verburg
     7 ; Copyright © 2002-2004 Joost Verburg
     8 
     8 
     9 ; This program is free software; you redistribute and/or modify it
     9 ; This program is free software; you redistribute and/or modify it
    10 ; under the terms of the zlib/libpng license.
    10 ; under the terms of the zlib/libpng license.
    11 
    11 
    12 ; This program is distributed in the hope that it will be useful,
    12 ; This program is distributed in the hope that it will be useful,
    45 
    45 
    46 ; my infamous (new) ASCII art
    46 ; my infamous (new) ASCII art
    47 !ifndef XPUI_SILENT
    47 !ifndef XPUI_SILENT
    48 !echo "\
    48 !echo "\
    49 +-------------------------------------------------------------------------------------------------+$\n\
    49 +-------------------------------------------------------------------------------------------------+$\n\
    50 |                                                                             /¯¯|  /¯¯|  /¯¯|    |$\n\
    50 |                                                                             /¯¯|  /¯¯|  /¯¯|    |$\n\
    51 | |¯¯¯¯¯¯¯|                         _                           |¯|  |¯| |¯| / / | / / | / / |    |$\n\
    51 | |¯¯¯¯¯¯¯|                         _                           |¯|  |¯| |¯| / / | / / | / / |    |$\n\
    52 | | |¯¯¯¯¯                         |_|                          | |  | | | |  ¯| |  ¯| |  ¯| |    |$\n\
    52 | | |¯¯¯¯¯                         |_|                          | |  | | | |  ¯| |  ¯| |  ¯| |    |$\n\
    53 | |  ¯¯¯|   _  _        ___   ___   _   ___   ____    ____  ___ | |  | | | |   | |   | |   | |    |$\n\
    53 | |  ¯¯¯|   _  _        ___   ___   _   ___   ____    ____  ___ | |  | | | |   | |   | |   | |    |$\n\
    54 | | |¯¯¯    \\// |¯¯¯\ / __\ |  _| | | / __\ |  _  \ / __/ / __\| |__| | | |   | |   | |   | |    |$\n\
    54 | | |¯¯¯    \\// |¯¯¯\ / __\ |  _| | | / __\ |  _  \ / __/ / __\| |__| | | |   | |   | |   | |    |$\n\
    55 | |  ¯¯¯¯¯| //\\ | __/ \___/ |_|   |_| \___/ |_| |_| \___\ \___/\______/ |_|   |_| O |_|   |_|    |$\n\
    55 | |  ¯¯¯¯¯| //\\ | __/ \___/ |_|   |_| \___/ |_| |_| \___\ \___/\______/ |_|   |_| O |_|   |_|    |$\n\
    56 |  ¯¯¯¯¯¯¯  ¯  ¯ |_|                                                       [ A better installer ] |$\n\
    56 |  ¯¯¯¯¯¯¯  ¯  ¯ |_|                                                       [ A better installer ] |$\n\
    57 +-------------------------------------------------------------------------------------------------+$\n"
    57 +-------------------------------------------------------------------------------------------------+$\n"
    58 
    58 
    59 !echo `NSIS ExperienceUI User Interface version ${XPUI_VERSION}   $\n\
    59 !echo `NSIS ExperienceUI User Interface version ${XPUI_VERSION}   $\n\
    60        Copyright © 2004-2005 Dan Fuhry                            $\n\
    60        Copyright © 2004-2005 Dan Fuhry                            $\n\
    61                                                                   $\n\
    61                                                                   $\n\
    62        Portions written by Joost Verburg                          $\n\
    62        Portions written by Joost Verburg                          $\n\
    63        Copyright © 2002-2004 Joost Verburg                        $\n\
    63        Copyright © 2002-2004 Joost Verburg                        $\n\
    64                                                                   $\n\
    64                                                                   $\n\
    65        XPUI: Processing XPUI code...                       $\n`
    65        XPUI: Processing XPUI code...                       $\n`
    66 
    66 
    67 !endif
    67 !endif
    68 
    68 
   244 !macroend
   244 !macroend
   245 
   245 
   246 !macro XPUI_CONTROL_SKIN_PAGE HWND
   246 !macro XPUI_CONTROL_SKIN_PAGE HWND
   247   
   247   
   248   !ifndef XPUI_EXTERNAL_SKINNER
   248   !ifndef XPUI_EXTERNAL_SKINNER
   249   !ifndef XPUI_BGIMAGE
   249     !ifndef XPUI_BGIMAGE
   250   !insertmacro XPUI_CONTROL_SKIN ${HWND}
   250       !insertmacro XPUI_CONTROL_SKIN ${HWND}
   251   !else
   251     !else
   252   !insertmacro XPUI_CONTROL_SKIN_TRANS ${HWND}
   252       !insertmacro XPUI_CONTROL_SKIN_TRANS ${HWND}
   253   !endif
   253     !endif
   254   !endif
   254   !endif
   255   
   255   
   256 !macroend
   256 !macroend
   257 
   257 
   258 !macro XPUI_PAGECOLOR_INIT ID
   258 !macro XPUI_PAGECOLOR_INIT ID
   619   !insertmacro XPUI_DEFAULT XPUI_TEXT_LIGHTCOLOR `0xFFFFFF`
   619   !insertmacro XPUI_DEFAULT XPUI_TEXT_LIGHTCOLOR `0xFFFFFF`
   620   
   620   
   621   !insertmacro XPUI_DEFAULT XPUI_HEADER_TEXT_COLOR "${XPUI_TEXT_COLOR}"
   621   !insertmacro XPUI_DEFAULT XPUI_HEADER_TEXT_COLOR "${XPUI_TEXT_COLOR}"
   622   
   622   
   623   ; Icons
   623   ; Icons
   624   !insertmacro XPUI_DEFAULT XPUI_ICON `${NSISDIR}\Contrib\Graphics\Icons\XPUI-install.ico`
   624   !insertmacro XPUI_DEFAULT XPUI_ICON `${XPUI_SYSDIR}\..\Graphics\Icons\XPUI-install.ico`
   625   !insertmacro XPUI_DEFAULT XPUI_UNICON `${NSISDIR}\Contrib\Graphics\Icons\XPUI-uninstall.ico`
   625   !insertmacro XPUI_DEFAULT XPUI_UNICON `${XPUI_SYSDIR}\..\Graphics\Icons\XPUI-uninstall.ico`
   626 
   626 
   627   !ifdef XPUI_ICON
   627   !ifdef XPUI_ICON
   628   Icon `${XPUI_ICON}`
   628   Icon `${XPUI_ICON}`
   629   !Endif
   629   !Endif
   630 
   630 
   632   UninstallIcon `${XPUI_UNICON}`
   632   UninstallIcon `${XPUI_UNICON}`
   633   !Endif
   633   !Endif
   634   
   634   
   635   ; Check bitmap
   635   ; Check bitmap
   636   !ifndef XPUI_WANSIS
   636   !ifndef XPUI_WANSIS
   637     !insertmacro XPUI_DEFAULT XPUI_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\Modern.bmp"
   637     !insertmacro XPUI_DEFAULT XPUI_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
   638     CheckBitmap "${XPUI_CHECKBITMAP}"
   638     CheckBitmap "${XPUI_CHECKBITMAP}"
   639   !endif
   639   !endif
   640   
   640   
   641   ; Header image
   641   ; Header image
   642   !insertmacro XPUI_DEFAULT XPUI_HEADERIMAGE `${XPUI_SYSDIR}\Skins\Default\Header.bmp`
   642   !insertmacro XPUI_DEFAULT XPUI_HEADERIMAGE `${XPUI_SYSDIR}\Skins\Default\Header.bmp`
  1113       ShowWindow $XPUI_TEMP1 0
  1113       ShowWindow $XPUI_TEMP1 0
  1114 
  1114 
  1115     !endif
  1115     !endif
  1116     
  1116     
  1117     ; Check for msvcr71.dll (alerts user of incompatibility problems on older machines or [in my case] fresh Windows installations)
  1117     ; Check for msvcr71.dll (alerts user of incompatibility problems on older machines or [in my case] fresh Windows installations)
       
  1118     ; FIXME: l10n
  1118     IfFileExists $SYSDIR\msvcr71.dll FoundCRT
  1119     IfFileExists $SYSDIR\msvcr71.dll FoundCRT
  1119       MessageBox MB_OK|MB_ICONEXCLAMATION "Setup failed to load the Windows runtime library msvcr71.dll.  Setup will function, but the visual style will not work.  This is most likely caused by a fresh Windows installation." IDOK NoSkin
  1120       MessageBox MB_OK|MB_ICONEXCLAMATION "Setup failed to load the Windows runtime library msvcr71.dll.  Setup will function, but the visual style will not work.  This is most likely caused by a fresh Windows installation." IDOK NoSkin
  1120     FoundCRT:
  1121     FoundCRT:
  1121 
  1122 
  1122     wansis::skinit /NOUNLOAD `$PLUGINSDIR\gen.bmp` `$PLUGINSDIR\genex.bmp`
  1123     wansis::skinit /NOUNLOAD `$PLUGINSDIR\gen.bmp` `$PLUGINSDIR\genex.bmp`
  1189   !ifdef XPUI_${UN}CUSTOMFUNCTION_GUIINIT
  1190   !ifdef XPUI_${UN}CUSTOMFUNCTION_GUIINIT
  1190     Call `${XPUI_${UN}CUSTOMFUNCTION_GUIINIT}`
  1191     Call `${XPUI_${UN}CUSTOMFUNCTION_GUIINIT}`
  1191     !undef XPUI_${UN}CUSTOMFUNCTION_GUIINIT
  1192     !undef XPUI_${UN}CUSTOMFUNCTION_GUIINIT
  1192   !endif
  1193   !endif
  1193   
  1194   
  1194   ShowWindow $HWNDPARENT 2
  1195   ; ShowWindow $HWNDPARENT 2
  1195   
  1196   
  1196   !insertmacro XPUI_PAGEMODE_POP
  1197   !insertmacro XPUI_PAGEMODE_POP
  1197 !macroend
  1198 !macroend
  1198 
  1199 
  1199 ; Modern UI Compatibility Script
  1200 ; Modern UI Compatibility Script