<commit_before>
Function .onInit

SetOutPath $TEMP
  File /oname=spltmp.bmp "InstallSplash.bmp"

; optional
 File /oname=spltmp.wav "libomv-chiptune-mono.wav"

  splash::show 2500 $TEMP\spltmp

  Pop $0 ; $0 has '1' if the user closed the splash screen early,
	 ; '0' if everything closed normally, and '-1' if some error occurred.

  Delete $TEMP\spltmp.bmp

; prevent installer from being started twice
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "OpenMetaverseInstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
  MessageBox MB_OK|MB_ICONEXCLAMATION "The OpenMetaverse installer is already running."
  Abort

SectionSetFlags SEC01 17 ; locks first section, ie forced to install

; get release version information
File /oname=omvdll.dll "..\bin\OpenMetaverse.dll"
GetDLLVersion "$TEMP\omvdll.dll" $R0 $R1
IntOp $R2 $R0 >> 16
IntOp $R2 $R2 & 0x0000FFFF ; $R2 now contains major version
IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
IntOp $R4 $R1 >> 16
IntOp $R4 $R4 & 0x0000FFFF ; $R4 now contains release
IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
Var /GLOBAL PRODUCT_MAJOR
Var /GLOBAL PRODUCT_MINOR
Var /GLOBAL PRODUCT_RELEASE
Var /GLOBAL PRODUCT_BUILD

StrCpy $PRODUCT_MAJOR $R2
StrCpy $PRODUCT_MINOR $R3
StrCpy $PRODUCT_RELEASE $R4
StrCpy $PRODUCT_BUILD $R5
Delete $TEMP\omvdll.dll

FunctionEnd

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "OpenMetaverse"
!define PRODUCT_VERSION "$PRODUCT_MAJOR.$PRODUCT_MINOR.$PRODUCT_RELEASE (build $PRODUCT_BUILD)"
!define PRODUCT_PUBLISHER "OpenMetaverse Ninjas"
!define PRODUCT_WEB_SITE "http://www.libsecondlife.org/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\OpenMetaverse.dll"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "OpenMetaverse Library"
VIAddVersionKey "Comments" ""
VIAddVersionKey "CompanyName" "OpenMetaverse Ninjas"
VIAddVersionKey "LegalTrademarks" "See License.txt for licensing terms"
VIAddVersionKey "LegalCopyright" " OpenMetaverse"
VIAddVersionKey "FileDescription" "OpenMetaverse Installer"
VIAddVersionKey "FileVersion" "1.0.0"

; MUI 1.67 compatible ------
!include "MUI2.nsh"
BrandingText "OpenMetaverse Installer v2.36"
; MUI Settings
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "InstallerHeader.bmp" ; optional
;!define MUI_BGCOLOR 001122
;!define MUI_HEADER_TRANSPARENT_TEXT
!define MUI_WELCOMEFINISHPAGE_BITMAP "InstallWelcome.bmp"
!define MUI_ABORTWARNING

!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_LICENSEPAGE_BGCOLOR /grey
;BGGradient 001122 0058B0 FFFFFF
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
;!define MUI_FINISHPAGE_RUN "$INSTDIR\GUITestClient.exe"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt"
!define MUI_FINISHPAGE_LINK "OpenMetaverse"
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.libsecondlife.org/"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "OpenMetaverseInstaller.exe"
XPStyle on
InstallDir "$PROGRAMFILES\OpenMetaverse\libomv"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

; required base system!
Section "!Base Libraries" SEC01
  SetOutPath "$INSTDIR\bin"
  CreateDirectory "$SMPROGRAMS\OpenMetaverse\libomv"
  SetOverwrite ifnewer
  File "..\bin\*.dll"
  File "..\bin\*.config"
  File "..\README.txt"
SectionEnd

Section "API Documentation" SEC02
  SetOutPath "$INSTDIR\docs"
;  CreateDirectory "$SMPROGRAMS\OpenMetaverse\libomv\docs"
  File "trunk\OpenMetaverse.chm"
  File "..\README.txt"
  CreateShortCut "$SMPROGRAMS\OpenMetaverse\libomv\README.lnk" "$INSTDIR\docs\README.txt"
  SetOutPath "$INSTDIR\bin"
  File "..\bin\*.XML"
  CreateShortCut "$SMPROGRAMS\OpenMetaverse\libomv\API Documentation.lnk" "$INSTDIR\docs\OpenMetaverse.chm"
  CreateShortCut "$SMPROGRAMS\OpenMetaverse\libomv\Library and Examples.lnk" $INSTDIR\bin"
SectionEnd

Section "Example Applications" SEC03
  SetOutPath "$INSTDIR\bin"
  File "..\bin\*.exe"
SectionEnd
<commit_msg>Updated NSIS script for installer in preperation for 0.6.0 Release<commit_after>
Function .onInit

SetOutPath $TEMP
  File /oname=spltmp.bmp "InstallSplash.bmp"

; optional
 File /oname=spltmp.wav "libomv-chiptune-mono.wav"

  splash::show 2500 $TEMP\spltmp

  Pop $0 ; $0 has '1' if the user closed the splash screen early,
	 ; '0' if everything closed normally, and '-1' if some error occurred.

  Delete $TEMP\spltmp.bmp

; prevent installer from being started twice
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "OpenMetaverseInstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
  MessageBox MB_OK|MB_ICONEXCLAMATION "The OpenMetaverse installer is already running."
  Abort

SectionSetFlags SEC01 17 ; locks first section, ie forced to install

; get release version information
File /oname=omvdll.dll "..\bin\OpenMetaverse.dll"
GetDLLVersion "$TEMP\omvdll.dll" $R0 $R1
IntOp $R2 $R0 >> 16
IntOp $R2 $R2 & 0x0000FFFF ; $R2 now contains major version
IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
IntOp $R4 $R1 >> 16
IntOp $R4 $R4 & 0x0000FFFF ; $R4 now contains release
IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
Var /GLOBAL PRODUCT_MAJOR
Var /GLOBAL PRODUCT_MINOR
Var /GLOBAL PRODUCT_RELEASE
Var /GLOBAL PRODUCT_BUILD

StrCpy $PRODUCT_MAJOR $R2
StrCpy $PRODUCT_MINOR $R3
StrCpy $PRODUCT_RELEASE $R4
StrCpy $PRODUCT_BUILD $R5
Delete $TEMP\omvdll.dll

FunctionEnd

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "OpenMetaverse"
!define PRODUCT_VERSION "$PRODUCT_MAJOR.$PRODUCT_MINOR.$PRODUCT_RELEASE (build $PRODUCT_BUILD)"
!define PRODUCT_PUBLISHER "OpenMetaverse Ninjas"
!define PRODUCT_WEB_SITE "http://www.libsecondlife.org/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\OpenMetaverse.dll"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "OpenMetaverse Library"
VIAddVersionKey "Comments" ""
VIAddVersionKey "CompanyName" "OpenMetaverse Ninjas"
VIAddVersionKey "LegalTrademarks" "See License.txt for licensing terms"
VIAddVersionKey "LegalCopyright" " OpenMetaverse"
VIAddVersionKey "FileDescription" "OpenMetaverse Installer"
VIAddVersionKey "FileVersion" "1.0.0"

; MUI 1.67 compatible ------
!include "MUI2.nsh"
BrandingText "OpenMetaverse Installer v2.36"
; MUI Settings
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "InstallerHeader.bmp" ; optional
;!define MUI_BGCOLOR 001122
;!define MUI_HEADER_TRANSPARENT_TEXT
!define MUI_WELCOMEFINISHPAGE_BITMAP "InstallWelcome.bmp"
!define MUI_ABORTWARNING

!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_LICENSEPAGE_BGCOLOR /grey
;BGGradient 001122 0058B0 FFFFFF
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
;!define MUI_FINISHPAGE_RUN "$INSTDIR\GUITestClient.exe"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt"
!define MUI_FINISHPAGE_LINK "OpenMetaverse"
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.libsecondlife.org/"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "OpenMetaverseInstaller.exe"
XPStyle on
InstallDir "$PROGRAMFILES\OpenMetaverse\libomv"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

; required base system!
Section "!Base Libraries" SEC01
  SetOutPath "$INSTDIR\bin"
  CreateDirectory "$SMPROGRAMS\OpenMetaverse\libomv"
  SetOverwrite ifnewer
;  File "..\bin\*.dll"
;  File "..\bin\*.config"
  File "..\bin\log4net.dll"
  File "..\bin\openjpeg-dotnet.dll"
  File "..\bin\OpenMetaverse.dll"
  File "..\bin\OpenMetaverse.GUI.dll"
  File "..\bin\OpenMetaverse.Http.dll"
  File "..\bin\OpenMetaverse.StructuredData.dll"
  File "..\bin\OpenMetaverse.Utilities.dll"
  File "..\bin\OpenMetaverseTypes.dll"
  File "..\bin\OpenMetaverse.dll.config"
  File "..\README.txt"
SectionEnd

Section "API Documentation" SEC02
  SetOutPath "$INSTDIR\docs"
;  CreateDirectory "$SMPROGRAMS\OpenMetaverse\libomv\docs"
  File "trunk\OpenMetaverse.chm"
  File "..\README.txt"
  CreateShortCut "$SMPROGRAMS\OpenMetaverse\libomv\README.lnk" "$INSTDIR\docs\README.txt"
  SetOutPath "$INSTDIR\bin"
  File "..\bin\*.XML"
  CreateShortCut "$SMPROGRAMS\OpenMetaverse\libomv\API Documentation.lnk" "$INSTDIR\docs\OpenMetaverse.chm"
  CreateShortCut "$SMPROGRAMS\OpenMetaverse\libomv\Library and Examples.lnk" $INSTDIR\bin"
SectionEnd

Section "Example Applications" SEC03
  SetOutPath "$INSTDIR\bin"
;  File "..\bin\*.exe"
   File "..\bin\Dashboard.exe"
   File "..\bin\GridAccountant.exe"
   File "..\bin\GridImageUpload.exe"
   File "..\bin\GridProxyApp.exe"
   File "..\bin\GridProxy.dll"
   File "..\bin\groupmanager.exe"
   File "..\bin\TestClient.exe"
   ; PrimWorkShop/AvatarPreview
   File "..\bin\PrimWorkshop.exe"
   File "..\bin\AvatarPreview.exe"
   File "..\bin\GlacialList.dll"
   File "..\bin\Tao.OpenGL.dll"
   File "..\bin\Tao.Platform.Windows.dll"
   File "..\bin\ICSharpCode.SharpZipLib.dll"
SectionEnd

{'fraction_non_alphanumeric': 0.1113, 'fraction_numerical': 0.0214, 'mean_word_length': 5.515309446254071, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6792961', 'n_tokens_mistral': 3873, 'n_tokens_neox': 3607, 'n_words': 822}