-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enforce a proper application location
- Loading branch information
Showing
4 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/electron-builder/templates/nsis/include/StrContains.nsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
; StrContains | ||
; This function does a case sensitive searches for an occurrence of a substring in a string. | ||
; It returns the substring if it is found. | ||
; Otherwise it returns null(""). | ||
; Written by kenglish_hi | ||
; Adapted from StrReplace written by dandaman32 | ||
|
||
|
||
Var STR_HAYSTACK | ||
Var STR_NEEDLE | ||
Var STR_CONTAINS_VAR_1 | ||
Var STR_CONTAINS_VAR_2 | ||
Var STR_CONTAINS_VAR_3 | ||
Var STR_CONTAINS_VAR_4 | ||
Var STR_RETURN_VAR | ||
|
||
Function StrContains | ||
Exch $STR_NEEDLE | ||
Exch 1 | ||
Exch $STR_HAYSTACK | ||
; Uncomment to debug | ||
;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK ' | ||
StrCpy $STR_RETURN_VAR "" | ||
StrCpy $STR_CONTAINS_VAR_1 -1 | ||
StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE | ||
StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK | ||
loop: | ||
IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1 | ||
StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1 | ||
StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found | ||
StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done | ||
Goto loop | ||
found: | ||
StrCpy $STR_RETURN_VAR $STR_NEEDLE | ||
Goto done | ||
done: | ||
Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the | ||
Exch $STR_RETURN_VAR | ||
FunctionEnd | ||
|
||
!macro _StrContainsConstructor OUT NEEDLE HAYSTACK | ||
Push `${HAYSTACK}` | ||
Push `${NEEDLE}` | ||
Call StrContains | ||
Pop `${OUT}` | ||
!macroend | ||
|
||
!define StrContains '!insertmacro "_StrContainsConstructor"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3217,8 +3217,8 @@ [email protected]: | |
yargs "^6.6.0" | ||
|
||
typescript@^2.2.1: | ||
version "2.2.1" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.1.tgz#4862b662b988a4c8ff691cc7969622d24db76ae9" | ||
version "2.2.2" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.2.tgz#606022508479b55ffa368b58fee963a03dfd7b0c" | ||
|
||
typescript@~2.1.5: | ||
version "2.1.6" | ||
|