diff --git a/InstallationScript/Functions.nsh b/InstallationScript/Functions.nsh index 30ddcae2..b5b712ea 100644 --- a/InstallationScript/Functions.nsh +++ b/InstallationScript/Functions.nsh @@ -1,4 +1,34 @@ +!include LogicLib.nsh !include FileFunc.nsh +!include .\NSISpcre.nsh + +!insertmacro REMatches + + +; FileExists is already part of LogicLib, but returns true for directories as well as files +!macro _FileExists2 _a _b _t _f + !insertmacro _LOGICLIB_TEMP + StrCpy $_LOGICLIB_TEMP "0" + StrCmp `${_b}` `` +4 0 ; if path is not blank, continue to next check + IfFileExists `${_b}` `0` +3 ; if path exists, continue to next check (IfFileExists returns true if this is a directory) + IfFileExists `${_b}\*.*` +2 0 ; if path is not a directory, continue to confirm exists + StrCpy $_LOGICLIB_TEMP "1" ; file exists + ; now we have a definitive value - the file exists or it does not + StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}` +!macroend +!undef FileExists + +!define FileExists `"" FileExists2` +!macro _DirExists _a _b _t _f + !insertmacro _LOGICLIB_TEMP + StrCpy $_LOGICLIB_TEMP "0" + StrCmp `${_b}` `` +3 0 ; if path is not blank, continue to next check + IfFileExists `${_b}\*.*` 0 +2 ; if directory exists, continue to confirm exists + StrCpy $_LOGICLIB_TEMP "1" + StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}` +!macroend +!define DirExists `"" DirExists` + ;-------------------------------- ; Function Macros @@ -10,6 +40,7 @@ !macroend !define TrimQuotes `!insertmacro _TrimQuotes` + ;-------------------------------- ; Functions @@ -32,6 +63,7 @@ Function TrimQuotes Exch $R0 FunctionEnd + ;-------------------------------- Function UninstallPreviousVersions @@ -39,15 +71,15 @@ Function UninstallPreviousVersions Push $R1 ReadRegStr $R0 HKLM "${RegUninstallKey}" "UninstallString" - StrCmp $R0 "" done - - ${TrimQuotes} $R0 $R0 - ${GetParent} $R0 $R1 + ${If} $R0 != "" + ${TrimQuotes} $R0 $R0 + ${GetParent} $R0 $R1 - ClearErrors - ExecWait '$R0 _?=$R1' + ClearErrors + ExecWait '$R0 /S _?=$R1' + RMDir /r "$R1" + ${EndIf} Pop $R1 Pop $R0 -done: FunctionEnd diff --git a/InstallationScript/Install.nsi b/InstallationScript/Install.nsi index 3dd29f67..d1cc6490 100644 --- a/InstallationScript/Install.nsi +++ b/InstallationScript/Install.nsi @@ -1,17 +1,26 @@ +!define APPNAME "Toastify" +!define PUBLISHER "Jesper Palm, Oren Nachman, Alessandro Attard Barbini" +!define DESCRIPTION "Toastify adds global hotkeys and toast notifications to Spotify" +!define VERSIONMAJOR 1 +!define VERSIONMINOR 10 +!define VERSIONBUILD 8 +!define HELPURL "https://github.com/aleab/toastify/issues" +!define UPDATEURL "https://github.com/aleab/toastify/releases" +!define ABOUTURL "https://aleab.github.io/toastify/" +!define ESTIMATEDSIZE 4510 + +!define RegUninstallKey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" + + !include LogicLib.nsh !include MUI.nsh !include x64.nsh !include WinVer.nsh - -!define ProgramName "Toastify" -!define RegUninstallKey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${ProgramName}" - +!include .\NSISpcre.nsh !include .\DotNetChecker.nsh !include .\Functions.nsh -!define EstimatedSize 4510 - -Name "${ProgramName} Installer" +Name "${APPNAME} Installer" RequestExecutionLevel admin CRCCheck force @@ -22,6 +31,7 @@ ManifestSupportedOS "{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" # Windows 10 OutFile "ToastifyInstaller.exe" InstallDir $PROGRAMFILES64\Toastify + ;-------------------------------- ; Pages @@ -30,32 +40,38 @@ Page directory Page instfiles # These statements modify settings for MUI_PAGE_FINISH -!define MUI_FINISHPAGE_AUTOCLOSE -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_NOTCHECKED -!define MUI_FINISHPAGE_RUN_TEXT "Launch ${ProgramName} now" -!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchApplication" + !define MUI_FINISHPAGE_AUTOCLOSE + !define MUI_FINISHPAGE_RUN + !define MUI_FINISHPAGE_RUN_NOTCHECKED + !define MUI_FINISHPAGE_RUN_TEXT "Launch ${APPNAME} now" + !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchApplication" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_LANGUAGE "English" +UninstPage components UninstPage uninstConfirm UninstPage instfiles + ;-------------------------------- ; Installer -Section "${ProgramName} (required)" +Var /GLOBAL PrevDesktopShortcutArgs +Var /GLOBAL PrevSMShortcutArgs +Var /GLOBAL PrevAutostartArgs + +Section "${APPNAME} (required)" SectionIn RO AddSize ${EstimatedSize} # Since process termination is non-destructive for Toastify, just kill it - DetailPrint "Shutting down ${ProgramName}..." + DetailPrint "Shutting down ${APPNAME}..." KillProcWMI::KillProc "Toastify.exe" Sleep 2000 # Uninstall previous versions - DetailPrint "Uninstalling previous versions of ${ProgramName}..." + DetailPrint "Uninstalling previous versions of ${APPNAME}..." Call UninstallPreviousVersions # Check .NET Framework @@ -92,41 +108,49 @@ Section "${ProgramName} (required)" Delete "$INSTDIR\uninstall.exe" # Write the uninstall keys for Windows - WriteRegStr HKLM "${RegUninstallKey}" "DisplayName" "Toastify" - WriteRegStr HKLM "${RegUninstallKey}" "UninstallString" '"$INSTDIR\uninst.exe"' + WriteRegStr HKLM "${RegUninstallKey}" "DisplayName" "${APPNAME}" WriteRegStr HKLM "${RegUninstallKey}" "DisplayIcon" "$INSTDIR\Toastify.exe,0" - WriteRegStr HKLM "${RegUninstallKey}" "Publisher" "Jesper Palm, Oren Nachman, Alessandro Attard Barbini" - WriteRegStr HKLM "${RegUninstallKey}" "Version" "1.10.8" - WriteRegStr HKLM "${RegUninstallKey}" "DisplayVersion" "1.10.8" + WriteRegStr HKLM "${RegUninstallKey}" "Publisher" "${PUBLISHER}" + WriteRegStr HKLM "${RegUninstallKey}" "Version" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}" + WriteRegStr HKLM "${RegUninstallKey}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}" + WriteRegStr HKLM "${RegUninstallKey}" "InstallLocation" "$INSTDIR" + WriteRegStr HKLM "${RegUninstallKey}" "UninstallString" '"$INSTDIR\uninst.exe"' + WriteRegStr HKLM "${RegUninstallKey}" "QuietUninstallString" '"$INSTDIR\uninst.exe" /S' + WriteRegStr HKLM "${RegUninstallKey}" "HelpLink" "${HELPURL}" + WriteRegStr HKLM "${RegUninstallKey}" "URLUpdateInfo" "${UPDATEURL}" + WriteRegStr HKLM "${RegUninstallKey}" "URLInfoAbout" "${ABOUTURL}" WriteRegDWORD HKLM "${RegUninstallKey}" "EstimatedSize" ${EstimatedSize} WriteRegDWORD HKLM "${RegUninstallKey}" "NoModify" 1 WriteRegDWORD HKLM "${RegUninstallKey}" "NoRepair" 1 WriteUninstaller "uninst.exe" - SectionEnd Section "Desktop icon" - CreateShortCut "$DESKTOP\Toastify.lnk" "$INSTDIR\Toastify.exe" "" "$INSTDIR\Toastify.exe" 0 + CreateShortCut "$DESKTOP\Toastify.lnk" "$INSTDIR\Toastify.exe" "$PrevDesktopShortcutArgs" "$INSTDIR\Toastify.exe" 0 SectionEnd Section "Start Menu icon" - CreateShortCut "$SMPROGRAMS\Toastify.lnk" "$INSTDIR\Toastify.exe" "" "$INSTDIR\Toastify.exe" 0 + CreateShortCut "$SMPROGRAMS\Toastify.lnk" "$INSTDIR\Toastify.exe" "$PrevSMShortcutArgs" "$INSTDIR\Toastify.exe" 0 SectionEnd Section /o "Autostart" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Toastify" '"$INSTDIR\Toastify.exe"' + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Toastify" '"$INSTDIR\Toastify.exe"$PrevAutostartArgs' SectionEnd + ;-------------------------------- ; Uninstaller -Section "Uninstall" - +Section "un.Toastify" + SectionIn RO + # Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Toastify" + DeleteRegValue HKCU "Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" "Toastify" DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Toastify" + DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "Toastify" - # Remove files and uninstaller + # Remove files Delete "$INSTDIR\Toastify.exe" Delete "$INSTDIR\Toastify.exe.config" Delete "$INSTDIR\Toastify.pdb" @@ -143,18 +167,21 @@ Section "Uninstall" Delete "$INSTDIR\LICENSE" Delete "$INSTDIR\LICENSE-3RD-PARTY" Delete "$INSTDIR\uninst.exe" - - # remove the settings directory - Delete "$APPDATA\Toastify.xml" - RMDir "$APPDATA\Toastify" + + # Remove log files + Delete "$LOCALAPPDATA\Toastify\Toastify.log*" # Remove shortcuts Delete "$DESKTOP\Toastify.lnk" Delete "$SMPROGRAMS\Toastify.lnk" - # Remove directories used - RMDir "$INSTDIR" + # Remove directories + RMDir /r "$INSTDIR" +SectionEnd +Section /o "un.Settings" + Delete "$APPDATA\Toastify\Toastify.cfg" + Delete "$LOCALAPPDATA\Toastify\proxy.sec" SectionEnd @@ -162,8 +189,66 @@ SectionEnd ; Functions Function .onInit + Push $R0 + Push $R1 + + StrCpy $INSTDIR "$PROGRAMFILES64\Toastify" + + StrCpy $PrevDesktopShortcutArgs "" + StrCpy $PrevSMShortcutArgs "" + StrCpy $PrevAutostartArgs "" + + # Get previous install location + ReadRegStr $R0 HKLM "${RegUninstallKey}" "InstallLocation" + ${If} $R0 != "" + StrCpy $INSTDIR "$R0" + ${Else} + ReadRegStr $R0 HKLM "${RegUninstallKey}" "UninstallString" + ${If} $R0 != "" + ${TrimQuotes} $R0 $R0 + ${GetParent} $R0 $R1 + StrCpy $INSTDIR "$R1" + ${EndIf} + ${EndIf} + + # Get the arguments of the previous Desktop shortcut + ${If} ${FileExists} "$DESKTOP\Toastify.lnk" + ClearErrors + ShellLink::GetShortCutArgs "$DESKTOP\Toastify.lnk" + ${IfNot} ${Errors} + Pop $PrevDesktopShortcutArgs + ${EndIf} + ${EndIf} + + # Get the arguments of the previous StartMenu shortcut + ${If} ${FileExists} "$SMPROGRAMS\Toastify.lnk" + ClearErrors + ShellLink::GetShortCutArgs "$SMPROGRAMS\Toastify.lnk" + ${IfNot} ${Errors} + Pop $PrevSMShortcutArgs + ${EndIf} + ${EndIf} + + # Get the arguments of the previous Autostart entry + ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Toastify" + ${If} $R0 != "" + ${RECaptureMatches} $0 '.*Toastify.exe"?(.*)' $R0 0 + StrCpy $PrevAutostartArgs $1 + ${EndIf} + + Pop $R1 + Pop $R0 FunctionEnd Function LaunchApplication - ShellExecAsUser::ShellExecAsUser "" "$INSTDIR\Toastify.exe" "" + # Should we use some command line argument? + ${If} $PrevAutostartArgs != "" + StrCpy $0 $PrevAutostartArgs + ${ElseIf} $PrevSMShortcutArgs != "" + StrCpy $0 $PrevSMShortcutArgs + ${Else} + StrCpy $0 $PrevDesktopShortcutArgs + ${EndIf} + + ShellExecAsUser::ShellExecAsUser "" "$INSTDIR\Toastify.exe" "$0" FunctionEnd diff --git a/InstallationScript/NSISpcre.nsh b/InstallationScript/NSISpcre.nsh new file mode 100644 index 00000000..3c856fa0 --- /dev/null +++ b/InstallationScript/NSISpcre.nsh @@ -0,0 +1,1070 @@ +/* +_____________________________________________________________________________ + + PCRE Functions Header v1.0 +_____________________________________________________________________________ + +An NSIS plugin providing Perl compatible regular expression functions. + +A simple wrapper around the excellent PCRE library which was written by +Philip Hazel, University of Cambridge. + +For those that require documentation on how to construct regular expressions, +please see http://www.pcre.org/ + +_____________________________________________________________________________ + +Copyright (c) 2007 Computerway Business Solutions Ltd. +Copyright (c) 2005 Google Inc. +Copyright (c) 1997-2006 University of Cambridge + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the name of Computerway Business Solutions Ltd. nor the names + of their contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Core PCRE Library Written by: Philip Hazel, University of Cambridge +C++ Wrapper functions by: Sanjay Ghemawat, Google Inc. +Support for PCRE_XXX modifiers by: Giuseppe Maxia +NSIS integration by: Rob Stocks, Computerway Business Solutions Ltd. + +_____________________________________________________________________________ + +Usage: +====== + + ... + # include this header + !include NSISpcre.nsh + ... + # include any functions that will be used in the installer + !insertmacro RESetOption + !insertmacro REClearOption + !insertmacro REGetOption + !insertmacro REClearAllOptions + !insertmacro REMatches + !insertmacro RECaptureMatches + !insertmacro REReplace + ... + # include any functions that will be used in the uninstaller + !insertmacro un.RESetOption + !insertmacro un.REClearOption + !insertmacro un.REGetOption + !insertmacro un.REClearAllOptions + !insertmacro un.REMatches + !insertmacro un.RECaptureMatches + !insertmacro un.REReplace + ... + # Use a function or integrate with LogicLib + Section|Function ... + ... + ${REMatches} $0 ^A(.*)Z" "ABC...XYZ" 0 + ... + ${If} "subject" =~ "pattern" + ... + ${EndIf} + ... + SectionEnd|FunctionEnd + ... + + See NSISpcreTest.nsi for examples. + +LogicLib Integration: +===================== + + By including this header, two additional string "operators" are added to LogicLib + as follows: + + a =~ b Test if subject a matches pattern b + a !~ b Test if subject a does not match pattern b + + E.g. + + ${If} $0 =~ ".*\\" + # $0 has a trailing backslash + ${Else} + # $0 does not have a trailing backslash + ${EndIf} + + ${If} $0 !~ "http://.*" + # $0 does not start "http://" + ${Else} + # $0 does start with "http://" + ${EndIf} + + You must insert the REMatches function in order to use these "operators" with: + + !insertmacro REMatches + or + !insertmacro un.REMatches + + To integrate with LogicLib in the uninstaller, prefix the operators with 'un.' + as follows: + + ${If} $0 un.=~ ".*\\" + ... + ${EndIf} + +Available Functions: +==================== + + RECheckPattern RESULT PATTERN + + Checks whether the supplied regular expression string is valid. + + E.g. ${RECheckPattern} $0 ".*" + # Will return "" becasue the pattern is valid + ${RECheckPattern} $0 "(.*" + # Will return an error because of the unmatched bracket + + Params: + + RESULT (output) + + The result of the test. An empty string if PATTERN is ok otherwise a + description of what was wrong with it. + + PATTERN (input) + + See REMatches. + + Notes: + + Unlike the other functions, this function does not set the error flag if + the supplied PATTERN is invalid. + + REQuoteMeta RESULT SUBJECT + + Escapes characters in the subject so the entire string will be interpreted + literally. + + E.g. ${REQuoteMeta} $0 ".*" + # Will return "\.\*" + + Params: + + RESULT (output) + + The converted from of SUBJECT with special characters escaped. + + SUBJECT (input) + + The string to convert. + + REMatches RESULT PATTERN SUBJECT PARTIAL + + Test whether a string matches a regular expression. + + E.g. ${REMatches} $0 "A(.*)Z" "ABC...XYZ" 0 + # Will return "true" + ${REMatches} $0 "A(.*)" "ABC...XYZ" 0 + # Will return "false" because partial matching wasn't requested + ${REMatches} $0 "A(.*)" "ABC...XYZ" 1 + # Will return "true" because partial matching was requested + + Params: + + RESULT (output) + + The result of the test. After the call, the return variable will contain + one of the following values: + "true" The string in SUBJECT matches the PATTERN + "false" The string in SUBJECT does not match the PATTERN + "error " There was an error compiling the PATTERN. The + error text will be returned after the word error. + The error flag will be set in this case. + + PATTERN (input) + + The PCRE-compatible regular expression to check for (without the leading + and trailing slashes and without any options). E.g. '.+' (not '/.+/s'). + See http://www.pcre.org/ for documentation & examples. + + SUBJECT (input) + + The string to test. + + PARTIAL (input) + + Either 1 or 0. Pass the value 1 to enable partial matches (part of the + SUBJECT string must match the PATTERN string) or 0 to force full matches + (the whole SUBJECT string must match the PATTERN string). + + Notes: + + See SetOptions for more control over pattern matching (e.g. case sensitivity). + The PARTIAL option is ignored if in multiline mode. + + RECaptureMatches RESULT PATTERN SUBJECT PARTIAL + + Test whether a string matches a regular expression and return any substrings + captured. + + E.g. ${RECaptureMatches} $0 "([^=]+)=(.+)" "pcre=excellent" + # Will return 2 in $0 because 2 strings were captured + Pop $1 # Will contain "pcre" + Pop $2 # Will contain "excellent" + + Params: + + RESULT (output) + + The string "false" if SUBJECT does not match PATTERN. + The number of substrings captured by capture groups if SUBJECT does match + PATTERN. + The string "error" followed by an error message if there was a problem + compiling PATTERN (the error flag will be set in this case). + + PATTERN (input) + + See REMatches. + + SUBJECT (input) + + See REMatches. + + PARTIAL (input) + + See REMatches. + + Notes: + + This function is the same as REMatches except that if SUBJECT matches PATTERN, + the number of substring captured is returned instead of the string "true". Also, + each captured string is available on the stack in left-to-right order of capture. + To use this function, first read the RESULT. If the error flag is not set and + RESULT is not "false", read it as an integer and pop that number of values from + the stack (these will be the captured substrings). + + This function can return 0 on a successful match indicating that SUBJECT matches + the PATTERN but that no substrings were captured (e.g. because no capture groups + were specified or because the NO_AUTO_CAPTURE option was set). + + REFind RESULT PATTERN SUBJECT + REFindNext RESULT + REFindClose + + Extracts captured substrings from SUBJECT according to PATTERN and advances the + position in SUBJECT so subsequent calls to REFindNext will obtain the next set + of captured substrings. + + E.g. ${REFind} "([0-9]+)" "123 456" + # Will capture "123" + ${REFindNext} + # Will capture "456" + ${REFindClose} + + Params: + + RESULT (output) + + Does not apply to REFindClose which has no parameters. + See RECaptureMatches. + For REFindNext, RESULT will be "false" if there were no more matches. + + PATTERN (input) + + Only applies to REFind. + See REMatches. + + SUBJECT (input) + + Only applies to REFind. + See REMatches. + + Notes: + + Partial matching is always enabled. + Not compatible with the NO_AUTO_CAPTURE option (see RESetOption). + PATTERNS containing no capture groups will be bracketed to create a single + capture group that matches the entire pattern. + REFindClose must be called to free resources in the plugin. It may only be + omitted if REFind is called again since this will automatically free any + resources allocated by a previous call to REFind. + + REReplace RESULT PATTERN SUBJECT REPLACEMENT REPLACEALL + + Replaces one or all occurances of PATTERN found in SUBJECT with REPLACEMENT. + + E.g. ${REReplace} $0 "h(.*)" "hello world!" "H\1" 0 + + Params: + + RESULT (output) + + The SUBJECT string with any replacements made. If no matches of PATTERN were + found in SUBJECT, an empty string will be returned. If there was an error + compiling PATTERN, the error flag will be set and the error will be returned. + + PATTERN (input) + + See REMatches. The regular expression to search for. Up to 9 captured substrings + can be referenced (by number 1-9) in the REPLACEMENT string if required. + + SUBJECT (input) + + The string on which to perform the replacements. + + REPLACEMENT (input) + + The string to replace occurances of PATTERN with. This string may refer to up to + 9 captured substrings defined in PATTERN by using '\1' to '\9'. + + REPLACEALL + + Either 0 or 1. To replace only the first occurance of PATTERN in SUBJECT with + REPLACEMENT, specify 0. To replace all occurances, specify 1. + + REClearAllOptions + + Clears all options and reverts to default PCRE pattern matching behaviour. + + E.g. ${REClearAllOptions} + + Params: + + No parameters. + + Notes: + + See RESetOption for a list of available options. + + RESetOption OPTION + + Sets the option specified in OPTION (turns it on). + + E.g. ${RESetOption} "CASELESS" + + Params: + + OPTION (input) + + The option to set. One of the following strings: + + CASELESS + Perform case-insensitive matching + MULTILINE + Enable matching of individual lines. '^' and '$' can be used to + match the starts and ends of lines instead of the start and end + of the subject string. Forces partial matching. + DOTALL + Allow '.' to match newlines within the subject. + EXTENDED + Ignore whitespace & comments in patterns + DOLLAR_ENDONLY + When not in multiline mode, force '$' to match only the end of the + entire string (otherwise it will also match prior to the last + newline if that newline terminates the string) + EXTRA + See PCRE documentation. + UTF8 + Enable UTF8 handling (untested from NSIS). + UNGREEDY + Set quantifiers to be ungreedy by default instead of greedy. This + also reverses the meaning of the '?' ungreedy qualifier to mean + greedy. + NO_AUTO_CAPTURE + Don't capture subgroups. + m + Synonym for MULTILINE (Perl syntax). + i + Synonym for CASELESS (Perl syntax). + s + Synonym for DOTALL (Perl syntax). + x + Synonym for EXTENDED (Perl syntax). + + Notes: + + Once set, the option will apply to all further calls until cleared. + + REClearOption OPTION + + Clears the option specified in OPTION (turns it off). + + E.g. ${REClearOption} "CASELESS" + + Params: + + OPTION (input) + + See RESetOption. + + Notes: + + Once cleared, the option will not apply to all further calls until set. + + REGetOption RESULT OPTION + + Obtains the current state of the specified OPTION. + + E.g. ${REGetOption} $0 "CASELESS" + + Params: + + RESULT (output) + + The state of the option: "true" if set and "false" otherwise. + + OPTION (input) + + See RESetOption. + +_____________________________________________________________________________ + +*/ + +!ifndef PCRELIB_INCLUDED +!define PCRELIB_INCLUDED + +!define _PCRELIB_UN + +!include LogicLib.nsh + +# Macros + +!macro RECheckPatternCall RESULT PATTERN + Push `${PATTERN}` + Call RECheckPattern + Pop ${RESULT} +!macroend + +!macro un.RECheckPatternCall RESULT PATTERN + Push `${PATTERN}` + Call un.RECheckPattern + Pop ${RESULT} +!macroend + +!macro REQuoteMetaCall RESULT SUBJECT + Push `${SUBJECT}` + Call REQuoteMeta + Pop ${RESULT} +!macroend + +!macro un.REQuoteMetaCall RESULT SUBJECT + Push `${SUBJECT}` + Call un.REQuoteMeta + Pop ${RESULT} +!macroend + +!macro REClearAllOptionsCall + Call REClearAllOptions +!macroend + +!macro un.REClearAllOptionsCall + Call un.REClearAllOptions +!macroend + +!macro REClearOptionCall OPTION + Push `${OPTION}` + Call REClearOption +!macroend + +!macro un.REClearOptionCall OPTION + Push `${OPTION}` + Call un.REClearOption +!macroend + +!macro RESetOptionCall OPTION + Push `${OPTION}` + Call RESetOption +!macroend + +!macro un.RESetOptionCall OPTION + Push `${OPTION}` + Call un.RESetOption +!macroend + +!macro REGetOptionCall RESULT OPTION + Push `${OPTION}` + Call REGetOption + Pop ${RESULT} +!macroend + +!macro un.REGetOptionCall RESULT OPTION + Push `${OPTION}` + Call un.REGetOption + Pop ${RESULT} +!macroend + +!macro REMatchesCall RESULT PATTERN SUBJECT PARTIAL + Push `${PATTERN}` + Push `${SUBJECT}` + Push `${PARTIAL}` + Push "0" + Call REMatches + Pop ${RESULT} +!macroend + +!macro un.REMatchesCall RESULT PATTERN SUBJECT PARTIAL + Push `${PATTERN}` + Push `${SUBJECT}` + Push `${PARTIAL}` + Push "0" + Call un.REMatches + Pop ${RESULT} +!macroend + +!macro RECaptureMatchesCall RESULT PATTERN SUBJECT PARTIAL + Push `${PATTERN}` + Push `${SUBJECT}` + Push `${PARTIAL}` + Push "1" + Call REMatches + Pop ${RESULT} +!macroend + +!macro un.RECaptureMatchesCall RESULT PATTERN SUBJECT PARTIAL + Push `${PATTERN}` + Push `${SUBJECT}` + Push `${PARTIAL}` + Push "1" + Call un.REMatches + Pop ${RESULT} +!macroend + +!macro REFindCall RESULT PATTERN SUBJECT + Push `${PATTERN}` + Push `${SUBJECT}` + Call REFind + Pop ${RESULT} +!macroend + +!macro un.REFindCall RESULT PATTERN SUBJECT + Push `${PATTERN}` + Push `${SUBJECT}` + Call un.REFind + Pop ${RESULT} +!macroend + +!macro REFindNextCall RESULT + Call REFindNext + Pop ${RESULT} +!macroend + +!macro un.REFindNextCall RESULT + Call un.REFindNext + Pop ${RESULT} +!macroend + +!macro REFindCloseCall + Call REFindClose +!macroend + +!macro un.REFindCloseCall + Call un.REFindClose +!macroend + +!macro REReplaceCall RESULT PATTERN SUBJECT REPLACEMENT REPLACEALL + Push `${PATTERN}` + Push `${SUBJECT}` + Push `${REPLACEMENT}` + Push `${REPLACEALL}` + Call REReplace + Pop ${RESULT} +!macroend + +!macro un.REReplaceCall RESULT PATTERN SUBJECT REPLACEMENT REPLACEALL + Push `${PATTERN}` + Push `${SUBJECT}` + Push `${REPLACEMENT}` + Push `${REPLACEALL}` + Call un.REReplace + Pop ${RESULT} +!macroend + +# Functions + +!macro RECheckPattern + !ifndef ${_PCRELIB_UN}RECheckPattern + !define ${_PCRELIB_UN}RECheckPattern `!insertmacro ${_PCRELIB_UN}RECheckPatternCall` + Function ${_PCRELIB_UN}RECheckPattern + + Exch $0 + + NSISpcre::RECheckPattern /NOUNLOAD $0 + + Pop $0 + + Exch $0 + + FunctionEnd + !endif +!macroend + +!macro REQuoteMeta + !ifndef ${_PCRELIB_UN}REQuoteMeta + !define ${_PCRELIB_UN}REQuoteMeta `!insertmacro ${_PCRELIB_UN}REQuoteMetaCall` + Function ${_PCRELIB_UN}REQuoteMeta + + Exch $0 + + NSISpcre::REQuoteMeta /NOUNLOAD $0 + + Pop $0 + + Exch $0 + + FunctionEnd + !endif +!macroend + +!macro REClearAllOptions + !ifndef ${_PCRELIB_UN}REClearAllOptions + !define ${_PCRELIB_UN}REClearAllOptions `!insertmacro ${_PCRELIB_UN}REClearAllOptionsCall` + Function ${_PCRELIB_UN}REClearAllOptions + + NSISpcre::REClearAllOptions /NOUNLOAD + + FunctionEnd + !endif +!macroend + +!macro REClearOption + !ifndef ${_PCRELIB_UN}REClearOption + !define ${_PCRELIB_UN}REClearOption `!insertmacro ${_PCRELIB_UN}REClearOptionCall` + Function ${_PCRELIB_UN}REClearOption + + # [OPTION] + Exch $0 + + NSISpcre::REClearOption /NOUNLOAD $0 + + Pop $0 + + FunctionEnd + !endif +!macroend + +!macro RESetOption + !ifndef ${_PCRELIB_UN}RESetOption + !define ${_PCRELIB_UN}RESetOption `!insertmacro ${_PCRELIB_UN}RESetOptionCall` + Function ${_PCRELIB_UN}RESetOption + + # [OPTION] + Exch $0 + + NSISpcre::RESetOption /NOUNLOAD $0 + + Pop $0 + + FunctionEnd + !endif +!macroend + +!macro REGetOption + !ifndef ${_PCRELIB_UN}REGetOption + !define ${_PCRELIB_UN}REGetOption `!insertmacro ${_PCRELIB_UN}REGetOptionCall` + Function ${_PCRELIB_UN}REGetOption + + # [OPTION] + Exch $0 + + NSISpcre::REGetOption /NOUNLOAD $0 + + Pop $0 + + Exch $0 # [RESULT] + + FunctionEnd + !endif +!macroend + +!macro REMatches + !ifndef ${_PCRELIB_UN}REMatches + !define ${_PCRELIB_UN}REMatches `!insertmacro ${_PCRELIB_UN}REMatchesCall` + !define ${_PCRELIB_UN}RECaptureMatches `!insertmacro ${_PCRELIB_UN}RECaptureMatchesCall` + Function ${_PCRELIB_UN}REMatches + + # [PATTERN, SUBJECT, PARTIAL, CAPTURE] + Exch $0 # [PATTERN, SUBJECT, PARTIAL, $0] + Exch 3 # [$0, SUBJECT, PARTIAL, PATTERN] + Exch $1 # [$0, SUBJECT, PARTIAL, $1] + Exch 2 # [$0, $1, PARTIAL, SUBJECT] + Exch $2 # [$0, $1, PARTIAL, $2] + Exch # [$0, $1, $2, PARTIAL] + Exch $3 # [$0, $1, $2, $3] + Push $4 + + ${If} $0 != 0 + StrCpy $4 5 # Push captured strings under the 5 items at the top of the stack + ${Else} + StrCpy $4 0 # Push captured strings to the top of the stack + ${EndIf} + + NSISpcre::REMatches /NOUNLOAD $1 $2 $3 $4 + Pop $1 # true, false or error + ClearErrors + ${If} $1 == "true" + Pop $1 # Number of captured patterns + ${If} $0 != 0 + # Capturing so leave captured strings on stack + # Returned value is number of captured strings + ${Else} + # Remove captured strings from the stack + # Returned value is 'true' + ${For} $2 1 $1 + Pop $3 + ${Next} + StrCpy $1 "true" + ${EndIf} + ${ElseIf} $1 == "false" + # Do nothing - just return 'false' + ${Else} + SetErrors + ${EndIf} + + StrCpy $0 $1 + + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Exch $0 + + FunctionEnd + !endif +!macroend + +!macro REFind + !ifndef ${_PCRELIB_UN}REFind + !define ${_PCRELIB_UN}REFind `!insertmacro ${_PCRELIB_UN}REFindCall` + Function ${_PCRELIB_UN}REFind + + # [PATTERN, SUBJECT] + Exch $0 # [PATTERN, $0] + Exch # [$0, PATTERN] + Exch $1 # [$0, $1] + + NSISpcre::REFind /NOUNLOAD $1 $0 2 + Pop $0 # true, false or error + ClearErrors + ${If} $0 == "true" + Pop $0 # Number of captured patterns + # Leave captured strings on stack + # Returned value is number of captured strings + ${ElseIf} $0 == "false" + # Do nothing - just return 'false' + ${Else} + SetErrors + ${EndIf} + + Pop $1 + Exch $0 + + FunctionEnd + !endif + !ifndef ${_PCRELIB_UN}REFindClose + !define ${_PCRELIB_UN}REFindClose `!insertmacro ${_PCRELIB_UN}REFindCloseCall` + Function ${_PCRELIB_UN}REFindClose + + NSISpcre::REFindClose /NOUNLOAD + + FunctionEnd + !endif +!macroend + +!macro REFindNext + !ifndef ${_PCRELIB_UN}REFindNext + !define ${_PCRELIB_UN}REFindNext `!insertmacro ${_PCRELIB_UN}REFindNextCall` + Function ${_PCRELIB_UN}REFindNext + + Push $0 + + NSISpcre::REFindNext /NOUNLOAD 1 + Pop $0 # true, false or error + ClearErrors + ${If} $0 == "true" + Pop $0 # Number of captured patterns + # Leave captured strings on stack + # Returned value is number of captured strings + ${ElseIf} $0 == "false" + # Do nothing - just return 'false' + ${Else} + SetErrors + ${EndIf} + + Exch $0 + + FunctionEnd + !endif +!macroend + +!macro REReplace + !ifndef ${_PCRELIB_UN}REReplace + !define ${_PCRELIB_UN}REReplace `!insertmacro ${_PCRELIB_UN}REReplaceCall` + Function ${_PCRELIB_UN}REReplace + + # [PATTERN, SUBJECT, REPLACEMENT, REPLACEALL] + Exch $0 # [PATTERN, SUBJECT, REPLACEMENT, $0] + Exch 3 # [$0, SUBJECT, REPLACEMENT, PATTERN] + Exch $1 # [$0, SUBJECT, REPLACEMENT, $1] + Exch 2 # [$0, $1, REPLACEMENT, SUBJECT] + Exch $2 # [$0, $1, REPLACEMENT, $2] + Exch # [$0, $1, $2, REPLACEMENT] + Exch $3 # [$0, $1, $2, $3] + + NSISpcre::REReplace /NOUNLOAD $1 $2 $3 $0 + Pop $1 # true, false or error + ClearErrors + ${If} $1 == "true" + Pop $0 # String with substitutions + ${ElseIf} $1 == "false" + StrCpy $0 "" + ${Else} + SetErrors + StrCpy $0 $1 + ${EndIf} + + Pop $3 + Pop $2 + Pop $1 + Exch $0 + + FunctionEnd + !endif +!macroend + +# LogicLib support (add =~ and !~ operators to LogicLib) +!macro _=~ _a _b _t _f + !define _t=${_t} + !ifdef _t= ; If no true label then make one + !define __t _LogicLib_Label_${__LINE__} + !else + !define __t ${_t} + !endif + + Push $0 + ${REMatches} $0 ${_b} ${_a} 1 + StrCmp $0 "true" +1 +3 + Pop $0 + Goto ${__t} + + Pop $0 + !define _f=${_f} + !ifndef _f= ; If a false label then go there + Goto ${_f} + !endif + !undef _f=${_f} + + !ifdef _t= ; If we made our own true label then place it + ${__t}: + !endif + !undef __t + !undef _t=${_t} +!macroend + +!macro _!~ _a _b _t _f + !define _t=${_t} + !ifdef _t= ; If no true label then make one + !define __t _LogicLib_Label_${__LINE__} + !else + !define __t ${_t} + !endif + + Push $0 + !ifdef PCRELLUN + ${un.REMatches} $0 ${_b} ${_a} 1 + !else + ${REMatches} $0 ${_b} ${_a} 1 + !endif + StrCmp $0 "true" +3 +1 + Pop $0 + Goto ${__t} + + Pop $0 + !define _f=${_f} + !ifndef _f= ; If a false label then go there + Goto ${_f} + !endif + !undef _f=${_f} + + !ifdef _t= ; If we made our own true label then place it + ${__t}: + !endif + !undef __t + !undef _t=${_t} +!macroend + +# Uninstaller support + +!macro un.RECheckPattern + !ifndef un.RECheckPattern + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro RECheckPattern + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REQuoteMeta + !ifndef un.REQuoteMeta + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REQuoteMeta + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REClearAllOptions + !ifndef un.REClearAllOptions + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REClearAllOptions + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REClearOption + !ifndef un.REClearOption + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REClearOption + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.RESetOption + !ifndef un.RESetOption + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro RESetOption + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REGetOption + !ifndef un.REGetOption + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REGetOption + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REMatches + !ifndef un.REMatches + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REMatches + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.RECaptureMatches + !ifndef un.RECaptureMatches + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro RECaptureMatches + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REFind + !ifndef un.REFind + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REFind + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REFindNext + !ifndef un.REFindNext + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REFindNext + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REFindClose + !ifndef un.REFindClose + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REFindClose + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro un.REReplace + !ifndef un.REReplace + !undef _PCRELIB_UN + !define _PCRELIB_UN `un.` + + !insertmacro REReplace + + !undef _PCRELIB_UN + !define _PCRELIB_UN + !endif +!macroend + +!macro _un.=~ _a _b _t _f + !define PCRELLUN + !insertmacro _=~ `${_a}` `${_b}` `${_t}` `${_f}` + !undef PCRELLUN +!macroend + +!macro _un.!~ _a _b _t _f + !define PCRELLUN + !insertmacro _!~ `${_a}` `${_b}` `${_t}` `${_f}` + !undef PCRELLUN +!macroend + +!endif + diff --git a/InstallationScript/Plugins/x64-ansi/NSISpcre.dll b/InstallationScript/Plugins/x64-ansi/NSISpcre.dll new file mode 100644 index 00000000..f15074f0 Binary files /dev/null and b/InstallationScript/Plugins/x64-ansi/NSISpcre.dll differ diff --git a/InstallationScript/Plugins/x64-unicode/NSISpcre.dll b/InstallationScript/Plugins/x64-unicode/NSISpcre.dll new file mode 100644 index 00000000..8e05f509 Binary files /dev/null and b/InstallationScript/Plugins/x64-unicode/NSISpcre.dll differ diff --git a/InstallationScript/DotNetChecker.dll b/InstallationScript/Plugins/x86-ansi/DotNetChecker.dll similarity index 100% rename from InstallationScript/DotNetChecker.dll rename to InstallationScript/Plugins/x86-ansi/DotNetChecker.dll diff --git a/InstallationScript/KillProcWMI.dll b/InstallationScript/Plugins/x86-ansi/KillProcWMI.dll similarity index 100% rename from InstallationScript/KillProcWMI.dll rename to InstallationScript/Plugins/x86-ansi/KillProcWMI.dll diff --git a/InstallationScript/Plugins/x86-ansi/NSISpcre.dll b/InstallationScript/Plugins/x86-ansi/NSISpcre.dll new file mode 100644 index 00000000..0ffe61b2 Binary files /dev/null and b/InstallationScript/Plugins/x86-ansi/NSISpcre.dll differ diff --git a/InstallationScript/ShellExecAsUser.dll b/InstallationScript/Plugins/x86-ansi/ShellExecAsUser.dll similarity index 100% rename from InstallationScript/ShellExecAsUser.dll rename to InstallationScript/Plugins/x86-ansi/ShellExecAsUser.dll diff --git a/InstallationScript/Plugins/x86-ansi/ShellLink.dll b/InstallationScript/Plugins/x86-ansi/ShellLink.dll new file mode 100644 index 00000000..f57ded34 Binary files /dev/null and b/InstallationScript/Plugins/x86-ansi/ShellLink.dll differ diff --git a/InstallationScript/Plugins/x86-unicode/DotNetChecker.dll b/InstallationScript/Plugins/x86-unicode/DotNetChecker.dll new file mode 100644 index 00000000..bf87a44b Binary files /dev/null and b/InstallationScript/Plugins/x86-unicode/DotNetChecker.dll differ diff --git a/InstallationScript/Plugins/x86-unicode/KillProcWMI.dll b/InstallationScript/Plugins/x86-unicode/KillProcWMI.dll new file mode 100644 index 00000000..7df28bcd Binary files /dev/null and b/InstallationScript/Plugins/x86-unicode/KillProcWMI.dll differ diff --git a/InstallationScript/Plugins/x86-unicode/NSISpcre.dll b/InstallationScript/Plugins/x86-unicode/NSISpcre.dll new file mode 100644 index 00000000..107c6c53 Binary files /dev/null and b/InstallationScript/Plugins/x86-unicode/NSISpcre.dll differ diff --git a/InstallationScript/Plugins/x86-unicode/ShellExecAsUser.dll b/InstallationScript/Plugins/x86-unicode/ShellExecAsUser.dll new file mode 100644 index 00000000..01a8c85a Binary files /dev/null and b/InstallationScript/Plugins/x86-unicode/ShellExecAsUser.dll differ diff --git a/InstallationScript/Plugins/x86-unicode/ShellLink.dll b/InstallationScript/Plugins/x86-unicode/ShellLink.dll new file mode 100644 index 00000000..386821dd Binary files /dev/null and b/InstallationScript/Plugins/x86-unicode/ShellLink.dll differ diff --git a/InstallationScript/README.txt b/InstallationScript/README.txt index 117a7efe..9341053d 100644 --- a/InstallationScript/README.txt +++ b/InstallationScript/README.txt @@ -1,2 +1,2 @@ -Copy all *.dll files in this directory to: - [NSIS install directory]\Plugins \ No newline at end of file +Copy the Plugins folder to: + [NSIS install directory]\ \ No newline at end of file diff --git a/LICENSE-3RD-PARTY b/LICENSE-3RD-PARTY index aa21d15d..b35a48e5 100644 --- a/LICENSE-3RD-PARTY +++ b/LICENSE-3RD-PARTY @@ -7,6 +7,9 @@ August 8, 2011, the same date as the binaries. 2. Managed Windows API (http://mwinapi.sourceforge.net/) 3. SpotifyAPI-NET (https://github.com/JohnnyCrazy/SpotifyAPI-NET) 4. Extended WPF Toolkit (https://github.com/xceedsoftware/wpftoolkit) +5. NSISpcre (NSIS plug-in) (http://nsis.sourceforge.net/NSISpcre_plug-in) +6. ShellLink (NSIS plug-in) (http://nsis.sourceforge.net/ShellLink_plug-in) + Toastify License - GNU General Public License version 2 (GPLv2) @@ -101,6 +104,7 @@ NO WARRANTY 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + Managed Windows API License - GNU Lesser General Public License (LGPL) ======================================================================= @@ -163,6 +167,7 @@ Each version is given a distinguishing version number. If the Library as you rec If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. + SpotifyAPI-NET - GNU Lesser General Public License v3.0 (LGPLv3) ================================================================ @@ -333,6 +338,7 @@ permanent authorization for you to choose that version for the Library. + Extended WPF Toolkit - MS-PL ============================ @@ -353,3 +359,59 @@ A "contributor" is any person that distributes its contribution under this licen (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. + + + +NSISpcre (NSIS plug-in) +======================= + +Copyright (c) 2007 Computerway Business Solutions Ltd. +Copyright (c) 2005 Google Inc. +Copyright (c) 1997-2006 University of Cambridge + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the name of Computerway Business Solutions Ltd. nor the names + of their contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Core PCRE Library Written by: Philip Hazel, University of Cambridge +C++ Wrapper functions by: Sanjay Ghemawat, Google Inc. +Support for PCRE_XXX modifiers by: Giuseppe Maxia +NSIS integration by: Rob Stocks, Computerway Business Solutions Ltd. + + + +ShellLink (NSIS plug-in) +======================== + +© 2004 Angelo Mandato + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. +This notice may not be removed or altered from any distribution. diff --git a/Toastify.sln b/Toastify.sln index dc14e5ed..4d80204c 100644 --- a/Toastify.sln +++ b/Toastify.sln @@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installation", "Installatio InstallationScript\DotNetChecker.nsh = InstallationScript\DotNetChecker.nsh InstallationScript\Functions.nsh = InstallationScript\Functions.nsh InstallationScript\Install.nsi = InstallationScript\Install.nsi + InstallationScript\NSISpcre.nsh = InstallationScript\NSISpcre.nsh EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Toastify", "Toastify\Toastify.csproj", "{CCC4A761-56D2-4188-807F-F7A547DFB031}" diff --git a/update-version.ps1 b/update-version.ps1 index c924ddbc..06e967b9 100644 --- a/update-version.ps1 +++ b/update-version.ps1 @@ -6,13 +6,16 @@ $AsciiEncoding = New-Object System.Text.ASCIIEncoding Write-Host -NoNewLine "Current version: " Get-Content "Toastify\version" $NewVersion = Read-Host -Prompt "New version" +$vMajor,$vMinor,$vBuild = $NewVersion.split('.') Write-Host # InstallationScript\Install.nsi Write-Host "Update: InstallationScript\Install.nsi" $FilePath = [System.IO.Path]::GetFullPath((Join-Path (pwd) "InstallationScript\Install.nsi")) -$Lines = (Get-Content 'InstallationScript\Install.nsi') -replace '("(Display)?Version") ".*"', "`$1 `"$NewVersion`"" +$Lines = (Get-Content 'InstallationScript\Install.nsi') -replace '(VERSIONMAJOR) .*', "`$1 $vMajor" +$Lines = (Get-Content 'InstallationScript\Install.nsi') -replace '(VERSIONMINOR) .*', "`$1 $vMinor" +$Lines = (Get-Content 'InstallationScript\Install.nsi') -replace '(VERSIONBUILD) .*', "`$1 $vBuild" [System.IO.File]::WriteAllLines($FilePath, $Lines) # Toastify\version