<commit_before>
Name openLCA

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION @openlcaversion@
!define COMPANY "GreenDelta GmbH"
!define URL http://www.greendelta.com

# MultiUser Symbol Definitions
!define MULTIUSER_EXECUTIONLEVEL Admin
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${REGKEY}"
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME MultiUserInstallMode
!define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
!define MULTIUSER_MUI
!define MULTIUSER_INSTALLMODE_COMMANDLINE
!define MULTIUSER_INSTALLMODE_INSTDIR openLCA
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
!define MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER "$(CurrentUserButtonLabel)"


# MUI Symbol Definitions
!define MUI_ICON "icon.ico"
!define MUI_LICENSEPAGE_CHECKBOX
!define MUI_STARTMENUPAGE_REGISTRY_ROOT SHCTX
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER openLCA
!define MUI_FINISHPAGE_RUN $INSTDIR\openLCA.exe
!define MUI_UNICON "orange-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_LANGDLL_REGISTRY_ROOT SHCTX
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage

# Included files
!include MultiUser.nsh
!include Sections.nsh
!include MUI2.nsh
!include LogicLib.nsh

# Reserved Files
!insertmacro MUI_RESERVEFILE_LANGDLL

# Variables
Var StartMenuGroup

# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE openlca\OPENLCA_README.txt
!insertmacro MULTIUSER_PAGE_INSTALLMODE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

# Helper functions
Function WriteToFile
Exch $0 ;file to write to
Exch
Exch $1 ;text to write
 
  FileOpen $0 $0 a #open file
  FileSeek $0 0 END #go to end
  FileWrite $0 $1 #write to file
  FileClose $0
 
Pop $1
Pop $0
FunctionEnd
 
!macro WriteToFile NewLine File String
  !if `${NewLine}` == true
  Push `${String}$\r$\n`
  !else
  Push `${String}`
  !endif
  Push `${File}`
  Call WriteToFile
!macroend
!define WriteToFile `!insertmacro WriteToFile false`
!define WriteLineToFile `!insertmacro WriteToFile true`

# Installer languages
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE German


# Installer attributes
OutFile setup.exe
# ALL USERS: InstallDir "$PROGRAMFILES64\openLCA"
InstallDir "$LOCALAPPDATA\openLCA"
CRCCheck on
XPStyle on
ShowInstDetails hide
VIProductVersion @openlcaversion@.0
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName openLCA
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription ""
VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright ""
# moved InstallDirRegKey functionality to onInit 
ShowUninstDetails hide

# Installer sections
Section "-openLCA @openlcaversion@" SEC0000
    SetOutPath $INSTDIR
    SetOverwrite on
    File /r openlca\*
    ${If} $LANGUAGE = 1031
        File /r german\openLCA.ini
    ${Else}
        File /r english\openLCA.ini
    ${EndIf}
    NSISdl::download http://guciodb.googlecode.com/files/guciodb-mysql-5.1.43-win.zip $TEMP\guciodb-mysql-5.1.43-win.zip
    ZipDLL::extractall $TEMP\guciodb-mysql-5.1.43-win.zip $INSTDIR
    WriteRegStr SHCTX "${REGKEY}\Components" "openLCA @openlcaversion@" 1

    ${If} $MultiUser.InstallMode == "CurrentUser"
        ${WriteToFile} `$INSTDIR\singleuserinstall.mrk` `marker file`
    ${EndIf}

SectionEnd

Section -post SEC0001
    WriteRegStr SHCTX "${REGKEY}" Path $INSTDIR
    SetOutPath $INSTDIR
    WriteUninstaller $INSTDIR\uninstall.exe
    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
    SetOutPath $SMPROGRAMS\$StartMenuGroup
    CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\openLCA.exe<commit_msg>removed MySQL package from installer<commit_after>
Name openLCA

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION @openlcaversion@
!define COMPANY "GreenDelta GmbH"
!define URL http://www.greendelta.com

# MultiUser Symbol Definitions
!define MULTIUSER_EXECUTIONLEVEL Admin
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${REGKEY}"
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME MultiUserInstallMode
!define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
!define MULTIUSER_MUI
!define MULTIUSER_INSTALLMODE_COMMANDLINE
!define MULTIUSER_INSTALLMODE_INSTDIR openLCA
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
!define MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER "$(CurrentUserButtonLabel)"


# MUI Symbol Definitions
!define MUI_ICON "icon.ico"
!define MUI_LICENSEPAGE_CHECKBOX
!define MUI_STARTMENUPAGE_REGISTRY_ROOT SHCTX
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER openLCA
!define MUI_FINISHPAGE_RUN $INSTDIR\openLCA.exe
!define MUI_UNICON "orange-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_LANGDLL_REGISTRY_ROOT SHCTX
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage

# Included files
!include MultiUser.nsh
!include Sections.nsh
!include MUI2.nsh
!include LogicLib.nsh

# Reserved Files
!insertmacro MUI_RESERVEFILE_LANGDLL

# Variables
Var StartMenuGroup

# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE openlca\OPENLCA_README.txt
!insertmacro MULTIUSER_PAGE_INSTALLMODE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

# Helper functions
Function WriteToFile
Exch $0 ;file to write to
Exch
Exch $1 ;text to write
 
  FileOpen $0 $0 a #open file
  FileSeek $0 0 END #go to end
  FileWrite $0 $1 #write to file
  FileClose $0
 
Pop $1
Pop $0
FunctionEnd
 
!macro WriteToFile NewLine File String
  !if `${NewLine}` == true
  Push `${String}$\r$\n`
  !else
  Push `${String}`
  !endif
  Push `${File}`
  Call WriteToFile
!macroend
!define WriteToFile `!insertmacro WriteToFile false`
!define WriteLineToFile `!insertmacro WriteToFile true`

# Installer languages
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE German


# Installer attributes
OutFile setup.exe
# ALL USERS: InstallDir "$PROGRAMFILES64\openLCA"
InstallDir "$LOCALAPPDATA\openLCA"
CRCCheck on
XPStyle on
ShowInstDetails hide
VIProductVersion @openlcaversion@.0
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName openLCA
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription ""
VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright ""
# moved InstallDirRegKey functionality to onInit 
ShowUninstDetails hide

# Installer sections
Section "-openLCA @openlcaversion@" SEC0000
    SetOutPath $INSTDIR
    SetOverwrite on
    File /r openlca\*
    ${If} $LANGUAGE = 1031
        File /r german\openLCA.ini
    ${Else}
        File /r english\openLCA.ini
    ${EndIf}
    WriteRegStr SHCTX "${REGKEY}\Components" "openLCA @openlcaversion@" 1

    ${If} $MultiUser.InstallMode == "CurrentUser"
        ${WriteToFile} `$INSTDIR\singleuserinstall.mrk` `marker file`
    ${EndIf}

SectionEnd

Section -post SEC0001
    WriteRegStr SHCTX "${REGKEY}" Path $INSTDIR
    SetOutPath $INSTDIR
    WriteUninstaller $INSTDIR\uninstall.exe
    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
    SetOutPath $SMPROGRAMS\$StartMenuGroup
    CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\openLCA.exe
{'fraction_non_alphanumeric': 0.08360360360360361, 'fraction_numerical': 0.008168168168168169, 'mean_word_length': 6.730733519034355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2341541', 'n_tokens_mistral': 3061, 'n_tokens_neox': 2868, 'n_words': 645}