<commit_before>; Script generated by the HM NIS Edit Script Wizard.

!include "x64.nsh"

SetCompressor zlib

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "JKLmouse"
!define PRODUCT_VERSION "0.1.0.1"
!define PRODUCT_PUBLISHER "<NAME>"
!define PRODUCT_WEB_SITE "http://www.jklmouse.com/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\JKLmouse.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

Function MyInit

; !define MUI_TEXT_WELCOME_INFO_TITLE "Welcome to $(^NameDA)"
; !define MUI_TEXT_ABORT_TITLE "Installation Canceled"
; !define MUI_TEXT_FINISH_INFO_REBOOT "Your computer must be restarted in order to complete the installation of $(^NameDA). Do you want to restart now?"
; !define MUI_TEXT_FINISH_REBOOTNOW "Restart now"
; !define MUI_TEXT_FINISH_REBOOTLATER "I want to manually restart later"

;  !define MUI_WELCOMEPAGE_TITLE "Welcome to JKLmouse!"
  !define MUI_WELCOMEPAGE_TEXT "\
Thanks for using JKLmouse, the automatic keyboard mouse for notebook and laptop computers.\n\n\
JKLmouse doesn't use special modes like other 'mouse key' programs. \
JKLmouse springs into action every time you press the mouse button, turning all of these keys into mouse keys while the button is down:\n\n\
The arrow keys\n\
The number keys (if you have a numeric keypad)\n\
The home row keys for left and right hand: SDF and JKL, and the keys above and below them.\n\n\
There are no special modes to toggle on and off. JKLmouse gives you mouse keys when you need them.\n\n\
Click Next to continue."

  !define MUI_WELCOMEPAGE_BUTTON "Install"


;  !define MUI_LICENSEPAGE_TEXT_BOTTOM "\
;If you accept the terms of the agreement, click Install to install ${PRODUCT_NAME} ${PRODUCT_VERSION} now."
;  !define MUI_LICENSEPAGE_BUTTON "Install"
  
;  !define MUI_INSTFILESPAGE_BUTTON "Finish"

  !define MUI_FINISHPAGE_NOAUTOCLOSE
FunctionEnd

Function MyFinish
  IfRebootFlag rebootYes rebootNo
  rebootYes:
    Goto rebootDone
  rebootNo:
    ExecShell "open" "$INSTDIR\Readme.html"
    Quit
  rebootdone:
FunctionEnd

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "JKLmouse.ico"
!define MUI_UNICON "JKLmouse.ico" ; "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Welcome page
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT MyInit
!insertmacro MUI_PAGE_WELCOME

; License page
;!define MUI_LICENSEPAGE_RADIOBUTTONS
;!insertmacro MUI_PAGE_LICENSE "..\UNLICENSE.txt"

; Directory page
;!insertmacro MUI_PAGE_DIRECTORY

; Instfiles page
;!define MUI_PAGE_CUSTOMFUNCTION_LEAVE MyFinish
!insertmacro MUI_PAGE_INSTFILES

; Finish page
!define MUI_PAGE_CUSTOMFUNCTION_PRE MyFinish
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

BrandingText "JKLmouse Setup "
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\Build\JKLmouse-Setup.exe"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" ${PRODUCT_NAME}
;VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Geary Labs" ; ${PRODUCT_PUBLISHER}
;VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "JKLmouse is a trademark of Geary Labs"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Public Domain software by <NAME>"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" ${PRODUCT_NAME}
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "0.1.0.1"
VIProductVersion "0.1.0.1"

Section "MainSection" SEC01
  ${If} ${RunningX64}
    ${DisableX64FSRedirection}
    SetRegView 64
    StrCpy $INSTDIR "$PROGRAMFILES64\JKLmouse"
    SetOutPath $INSTDIR
    File /oname=JKLmouse.exe "..\Build\JKLmouse64.exe"
  ${Else}
    StrCpy $INSTDIR "$PROGRAMFILES\JKLmouse"
    SetOutPath $INSTDIR
    File /oname=JKLmouse.exe "..\Build\JKLmouse32.exe"
  ${EndIf}
  SetShellVarContext all
  SetOutPath "$INSTDIR"
  SetOverwrite ifnewer
  CreateDirectory "$SMSTARTUP"
  CreateShortCut "$SMSTARTUP\JKLmouse.lnk" "$INSTDIR\JKLmouse.exe"
  ;File "Readme.html"
  ;File "upleft.gif"
  ;File "up.gif"
  ;File "upright.gif"
  ;File "left.gif"
  ;File "right.gif"
  ;File "downleft.gif"
  ;File "down.gif"
  ;File "downright.gif"
  Exec "$INSTDIR\JKLmouse.exe"
SectionEnd

Section -AdditionalIcons
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateDirectory "$SMPROGRAMS\JKLmouse"
  CreateShortCut "$SMPROGRAMS\JKLmouse\JKLmouse Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  CreateShortCut "$SMPROGRAMS\JKLmouse\Uninstall JKLmouse.lnk" "$INSTDIR\uninst.exe"
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\JKLmouse.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\JKLmouse.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd


Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd

Function un.onInit
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  Abort
FunctionEnd

Section Uninstall
  ${If} ${RunningX64}
    ${DisableX64FSRedirection}
    SetRegView 64
  ${EndIf}
  Delete "$INSTDIR\${PRODUCT_NAME}.url"
  Delete "$INSTDIR\uninst.exe"
  Delete "$INSTDIR\JKLmouse.exe"<commit_msg>Close any running instance on install and uninstall<commit_after>; Script generated by the HM NIS Edit Script Wizard.

!include "x64.nsh"

SetCompressor zlib

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "JKLmouse"
!define PRODUCT_VERSION "0.1.0.1"
!define PRODUCT_PUBLISHER "<NAME>"
!define PRODUCT_WEB_SITE "http://www.jklmouse.com/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\JKLmouse.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

Function MyInit

; !define MUI_TEXT_WELCOME_INFO_TITLE "Welcome to $(^NameDA)"
; !define MUI_TEXT_ABORT_TITLE "Installation Canceled"
; !define MUI_TEXT_FINISH_INFO_REBOOT "Your computer must be restarted in order to complete the installation of $(^NameDA). Do you want to restart now?"
; !define MUI_TEXT_FINISH_REBOOTNOW "Restart now"
; !define MUI_TEXT_FINISH_REBOOTLATER "I want to manually restart later"

;  !define MUI_WELCOMEPAGE_TITLE "Welcome to JKLmouse!"
  !define MUI_WELCOMEPAGE_TEXT "\
Thanks for using JKLmouse, the automatic keyboard mouse for notebook and laptop computers.\n\n\
JKLmouse doesn't use special modes like other 'mouse key' programs. \
JKLmouse springs into action every time you press the mouse button, turning all of these keys into mouse keys while the button is down:\n\n\
The arrow keys\n\
The number keys (if you have a numeric keypad)\n\
The home row keys for left and right hand: SDF and JKL, and the keys above and below them.\n\n\
There are no special modes to toggle on and off. JKLmouse gives you mouse keys when you need them.\n\n\
Click Next to continue."

  !define MUI_WELCOMEPAGE_BUTTON "Install"


;  !define MUI_LICENSEPAGE_TEXT_BOTTOM "\
;If you accept the terms of the agreement, click Install to install ${PRODUCT_NAME} ${PRODUCT_VERSION} now."
;  !define MUI_LICENSEPAGE_BUTTON "Install"
  
;  !define MUI_INSTFILESPAGE_BUTTON "Finish"

  !define MUI_FINISHPAGE_NOAUTOCLOSE
FunctionEnd

Function MyFinish
  IfRebootFlag rebootYes rebootNo
  rebootYes:
    Goto rebootDone
  rebootNo:
    ExecShell "open" "$INSTDIR\Readme.html"
    Quit
  rebootdone:
FunctionEnd

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "JKLmouse.ico"
!define MUI_UNICON "JKLmouse.ico" ; "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Welcome page
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT MyInit
!insertmacro MUI_PAGE_WELCOME

; License page
;!define MUI_LICENSEPAGE_RADIOBUTTONS
;!insertmacro MUI_PAGE_LICENSE "..\UNLICENSE.txt"

; Directory page
;!insertmacro MUI_PAGE_DIRECTORY

; Instfiles page
;!define MUI_PAGE_CUSTOMFUNCTION_LEAVE MyFinish
!insertmacro MUI_PAGE_INSTFILES

; Finish page
!define MUI_PAGE_CUSTOMFUNCTION_PRE MyFinish
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

BrandingText "JKLmouse Setup "
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\Build\JKLmouse-Setup.exe"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" ${PRODUCT_NAME}
;VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Geary Labs" ; ${PRODUCT_PUBLISHER}
;VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "JKLmouse is a trademark of Geary Labs"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Public Domain software by <NAME>"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" ${PRODUCT_NAME}
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "0.1.0.1"
VIProductVersion "0.1.0.1"

Section "MainSection" SEC01
  ${If} ${RunningX64}
    ${DisableX64FSRedirection}
    SetRegView 64
    StrCpy $INSTDIR "$PROGRAMFILES64\JKLmouse"
  ${Else}
    StrCpy $INSTDIR "$PROGRAMFILES\JKLmouse"
  ${EndIf}
  SetOutPath $INSTDIR
  ; Close running instance
  FindWindow $0 "AutoHotKey" "$INSTDIR\JKLmouse.exe"
  SendMessage $0 16 0 0
  ${If} ${RunningX64}
    File /oname=JKLmouse.exe "..\Build\JKLmouse64.exe"
  ${Else}
    File /oname=JKLmouse.exe "..\Build\JKLmouse32.exe"
  ${EndIf}
  SetShellVarContext all
  SetOutPath "$INSTDIR"
  SetOverwrite ifnewer
  CreateDirectory "$SMSTARTUP"
  CreateShortCut "$SMSTARTUP\JKLmouse.lnk" "$INSTDIR\JKLmouse.exe"
  ;File "Readme.html"
  ;File "upleft.gif"
  ;File "up.gif"
  ;File "upright.gif"
  ;File "left.gif"
  ;File "right.gif"
  ;File "downleft.gif"
  ;File "down.gif"
  ;File "downright.gif"
  Exec "$INSTDIR\JKLmouse.exe"
SectionEnd

Section -AdditionalIcons
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateDirectory "$SMPROGRAMS\JKLmouse"
  CreateShortCut "$SMPROGRAMS\JKLmouse\JKLmouse Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  CreateShortCut "$SMPROGRAMS\JKLmouse\Uninstall JKLmouse.lnk" "$INSTDIR\uninst.exe"
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\JKLmouse.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\JKLmouse.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd


Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd

Function un.onInit
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  Abort
FunctionEnd

Section Uninstall
  ; Close running instance
  FindWindow $0 "AutoHotKey" "$INSTDIR\JKLmouse.exe"
  SendMessage $0 16 0 0
  ${If} ${RunningX64}
    ${DisableX64FSRedirection}
    SetRegView 64
  ${EndIf}
  Delete "$INSTDIR\${PRODUCT_NAME}.url"
  Delete "$INSTDIR\uninst.exe"
  Delete "$INSTDIR\JKLmouse.exe"
{'fraction_non_alphanumeric': 0.10703706668801537, 'fraction_numerical': 0.007365303018173085, 'mean_word_length': 5.833698030634573, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, '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': '466518', 'n_tokens_mistral': 4700, 'n_tokens_neox': 4401, 'n_words': 1072}