summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-23 23:47:18 +0800
committerruki <[email protected]>2020-10-23 23:47:18 +0800
commit0917b2e02dbdd2380892afc441d422679cd38535 (patch)
tree51aab91b8d90a61a9671d111c8c6c5c1a508663d /scripts
parent6cbb9436e46ed104d44bb9d9fd80813028d4a02a (diff)
add xrepo to nsi
Diffstat (limited to 'scripts')
-rw-r--r--scripts/installer.nsi31
1 files changed, 16 insertions, 15 deletions
diff --git a/scripts/installer.nsi b/scripts/installer.nsi
index 7cafc82ae..4afa6c276 100644
--- a/scripts/installer.nsi
+++ b/scripts/installer.nsi
@@ -1,9 +1,9 @@
; xmake.nsi
;
; This script is perhaps one of the simplest NSIs you can make. All of the
-; optional settings are left to their default settings. The installer simply
+; optional settings are left to their default settings. The installer simply
; prompts the user asking them where to install, and drops a copy of xmake.nsi
-; there.
+; there.
;--------------------------------
; includes
@@ -100,13 +100,13 @@ ManifestDPIAware true
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0"
Quit
${EndSwitch}
-
+
; The UAC plugin changes the error level even in the inner process, reset it.
; note fix install exit code 1223 to 0 with slient /S
SetErrorLevel 0
SetShellVarContext all
!macroend
-
+
;--------------------------------
; Install Pages
@@ -128,7 +128,7 @@ ManifestDPIAware true
;--------------------------------
; Languages
-
+
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
@@ -159,7 +159,7 @@ Var NOADMIN
Function TrimQuote
Exch $R1 ; Original string
Push $R2
-
+
Loop:
StrCpy $R2 "$R1" 1
StrCmp "$R2" "'" TrimLeft
@@ -169,10 +169,10 @@ Loop:
StrCmp "$R2" "$\t" TrimLeft
StrCmp "$R2" " " TrimLeft
GoTo Loop2
-TrimLeft:
+TrimLeft:
StrCpy $R1 "$R1" "" 1
Goto Loop
-
+
Loop2:
StrCpy $R2 "$R1" 1 -1
StrCmp "$R2" "'" TrimRight
@@ -182,10 +182,10 @@ Loop2:
StrCmp "$R2" "$\t" TrimRight
StrCmp "$R2" " " TrimRight
GoTo Done
-TrimRight:
+TrimRight:
StrCpy $R1 "$R1" -1
Goto Loop2
-
+
Done:
Pop $R2
Exch $R1
@@ -225,17 +225,18 @@ FunctionEnd
Section "XMake (required)" InstallExeutable
SectionIn RO
-
+
; Set output path to the installation directory.
SetOutPath $InstDir
; Remove previous directories used
RMDir /r "$InstDir"
-
+
; Put file there
File /r /x ".DS_Store" /x "*.swp" "..\xmake\*.*"
File "..\*.md"
File "..\core\build\xmake.exe"
+ File "..\scripts\xrepo.bat"
File /r /x ".DS_Store" "..\winenv"
WriteUninstaller "uninstall.exe"
@@ -244,7 +245,7 @@ Section "XMake (required)" InstallExeutable
; Write uac info
WriteRegStr ${RootKey} ${RegUninstall} "NoAdmin" "$NOADMIN"
-
+
; Write the uninstall keys for Windows
WriteRegStr ${RootKey} ${RegUninstall} "DisplayName" "XMake build utility"
WriteRegStr ${RootKey} ${RegUninstall} "DisplayIcon" '"$InstDir\xmake.exe"'
@@ -273,7 +274,7 @@ Section "XMake (required)" InstallExeutable
${Else}
!insertmacro AddReg ${HKCU}
${EndIf}
-
+
SectionEnd
Section "Add to PATH" InstallPath
@@ -318,7 +319,7 @@ Function un.onInit
ReadRegStr $NOADMIN ${HKLM} ${RegUninstall} "NoAdmin"
IfErrors 0 +2
ReadRegStr $NOADMIN ${HKCU} ${RegUninstall} "NoAdmin"
-
+
${IfNot} $NOADMIN == "true"
!insertmacro Init "uninstaller"
${EndIf}