From a5fb305197612efc25c5f3c34bcba1e206378b8e Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Tue, 6 Jun 2023 15:57:08 +0200 Subject: Long Path checkbox --- scripts/installer.nsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts') diff --git a/scripts/installer.nsi b/scripts/installer.nsi index 9d309fdbe..9257f235c 100644 --- a/scripts/installer.nsi +++ b/scripts/installer.nsi @@ -285,6 +285,19 @@ Section "XMake (required)" InstallExeutable SectionEnd +Section "Enable Long Path" LongPath + ; Get git path from the registry + ReadRegStr $R0 ${HKLM} "SOFTWARE\GitForWindows" "InstallPath" + ${If} $NOADMIN == "false" + ; In admin enable long path on both git system config and in registry + WriteRegDWORD ${HKLM} "SYSTEM\CurrentControlSet\Control\FileSystem" "LongPathsEnabled" 1 + Exec '"$R0\cmd\git.exe" config --system core.longpaths true' + ${Else} + ; Enable only in git global config + Exec '"$R0\cmd\git.exe" config --global core.longpaths true' + ${EndIf} +SectionEnd + Section "Add to PATH" InstallPath ${If} $NOADMIN == "false" @@ -314,11 +327,13 @@ SectionEnd ; Language strings LangString DESC_InstallExeutable ${LANG_ENGLISH} "A cross-platform build utility based on Lua" LangString DESC_InstallPath ${LANG_ENGLISH} "Add xmake to PATH" +LangString DESC_LongPath ${LANG_ENGLISH} "Enable long path on both Windows and Git" ; Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${InstallExeutable} $(DESC_InstallExeutable) !insertmacro MUI_DESCRIPTION_TEXT ${InstallPath} $(DESC_InstallPath) +!insertmacro MUI_DESCRIPTION_TEXT ${LongPath} $(DESC_LongPath) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- -- cgit v1.3.1