From b42d607686a020619b1bf2f1a5348250bb8befae Mon Sep 17 00:00:00 2001 From: "Hong Jen-Yee (PCMan)" Date: Sun, 18 Oct 2026 21:26:49 -0700 Subject: [PATCH 1/2] installer: replace InstallOrSkip and md5dll with clean uninstall and direct File extraction In-use binary replacement during upgrade does not benefit from MD5 comparison against candidate files because code signing and Authenticode timestamping yield differing file hashes even when source code is unchanged. Furthermore, when uninstallOldVersion performs SafeDeleteFile, target binary paths on disk are guaranteed to be vacant (renamed to .deleted if in-use), allowing standard native NSIS File commands to write candidates directly with zero write errors. - Update SafeDeleteFile in macros.nsh to restore RebootFlag when rename succeeds, so temporary file cleanup on reboot does not trigger premature reboot prompts or installation failures. - Add CleanOldBinaries macro in macros.nsh to centralize safe deletion/renaming of PIME DLLs and launcher in across x86, x64, and ARM64. - In installer.nsi, run CleanOldBinaries during uninstallOldVersion, SecMain, and uninstallation to ensure target paths are free before installation. - Remove candidate file extraction into in .onInit, InstallOrSkip macro, and CheckFileMD5Equal macro. - Replace InstallOrSkip calls with standard NSIS File commands directly in sections. - Remove the obsolete md5dll plugin directory and its plugin registration. Generated with assistance from Antigravity (Gemini 3.8 Flash). --- installer/installer.nsi | 69 ++---- installer/macros.nsh | 164 +++---------- installer/md5dll/ANSI/md5dll.dll | Bin 6656 -> 0 bytes installer/md5dll/MD5.cpp | 367 ---------------------------- installer/md5dll/MD5.h | 100 -------- installer/md5dll/MD5Example.nsi | 55 ----- installer/md5dll/UNICODE/md5dll.dll | Bin 6656 -> 0 bytes installer/md5dll/api.h | 83 ------- installer/md5dll/build.bat | 17 -- installer/md5dll/md5dll.cpp | 140 ----------- installer/md5dll/md5dll.def | 10 - installer/md5dll/md5dll.rc | 100 -------- installer/md5dll/nsis_tchar.h | 215 ---------------- installer/md5dll/pluginapi.h | 103 -------- installer/md5dll/readme.txt | 68 ------ 15 files changed, 62 insertions(+), 1429 deletions(-) delete mode 100644 installer/md5dll/ANSI/md5dll.dll delete mode 100644 installer/md5dll/MD5.cpp delete mode 100644 installer/md5dll/MD5.h delete mode 100644 installer/md5dll/MD5Example.nsi delete mode 100644 installer/md5dll/UNICODE/md5dll.dll delete mode 100644 installer/md5dll/api.h delete mode 100644 installer/md5dll/build.bat delete mode 100644 installer/md5dll/md5dll.cpp delete mode 100644 installer/md5dll/md5dll.def delete mode 100644 installer/md5dll/md5dll.rc delete mode 100644 installer/md5dll/nsis_tchar.h delete mode 100644 installer/md5dll/pluginapi.h delete mode 100644 installer/md5dll/readme.txt diff --git a/installer/installer.nsi b/installer/installer.nsi index 3ce255c06..881e39a81 100644 --- a/installer/installer.nsi +++ b/installer/installer.nsi @@ -31,8 +31,6 @@ !addplugindir /x86-unicode "StdUtils.2015-11-16\Plugins\Release_Unicode" !include "StdUtils.nsh" ; for ExecShellAsUser() -; We need the MD5 plugin -!addplugindir /x86-unicode "md5dll\UNICODE" ; We need the INetC (internet client) plugin ; https://nsis.sourceforge.io/Inetc_plug-in @@ -133,27 +131,15 @@ Function uninstallOldVersion !insertmacro UnregisterTextService 64 "$INSTDIR\x64\PIMETextService.dll" ${ElseIf} ${IsNativeARM64} !insertmacro UnregisterTextService 64 "$INSTDIR\arm64\PIMETextService.dll" - ${If} ${FileExists} "$INSTDIR\x64" - !insertmacro UnregisterTextService 64 "$INSTDIR\x64\PIMETextService.dll" - !insertmacro SafeDeleteFile "$INSTDIR\x64\PIMETextService.dll" - RMDir /REBOOTOK "$INSTDIR\x64" - ${EndIf} ${EndIf} ; Remove the launcher from auto-start and clean registry !insertmacro CleanPIMERegistry - ; NOTE: Why binary files (DLLs, EXE) and binary folders (x86, x64, arm64) are NOT deleted here: - ; 1. Folders: On Windows, scheduling directories for deletion on reboot (via RMDir /REBOOTOK) - ; while this installer is about to install new files into those exact same directories - ; would cause Windows PendingFileRenameOperations to wipe the newly installed directories - ; on the next system reboot. - ; 2. Binaries: PIMELauncher.exe and PIMETextService.dll are handled cleanly by InstallOrSkip - ; later in the installation sections. If their MD5 checksum matches the new version, they - ; are kept untouched without unnecessary writes or reboot requirements. If their MD5 - ; differs and they are currently locked by active applications, InstallOrSkip safely renames - ; the locked file to a unique .deleted temporary file, freeing the path so the new binary - ; can be installed immediately without forcing a reboot. + ; Safely remove or rename old binaries so the destination paths are free for writing. + ; If files are locked by running applications, SafeDeleteFile renames them to unique + ; temporary files scheduled for deletion on reboot without blocking immediate installation. + !insertmacro CleanOldBinaries ; Clean old backend and data files Delete "$INSTDIR\backends.json" @@ -223,16 +209,6 @@ Function .onInit Reboot ${EndIf} - ; Extract candidate binaries into $PLUGINSDIR (NSIS temporary plugin directory, - ; which Windows automatically cleans up when the installer exits). - ; This allows InstallOrSkip to compute MD5 checksums of the new candidates against - ; existing files on disk, and copy them safely via CopyFiles without triggering - ; raw NSIS "File write error: Abort/Retry/Ignore" popups when files are in use. - File "/oname=$PLUGINSDIR\PIMETextService_x86.dll" "..\build\PIMETextService\Release\PIMETextService.dll" - File "/oname=$PLUGINSDIR\PIMETextService_x64.dll" "..\build64\PIMETextService\Release\PIMETextService.dll" - File "/oname=$PLUGINSDIR\PIMETextService_arm64.dll" "..\build_arm64\PIMETextService\Release\PIMETextService_arm64.dll" - File "/oname=$PLUGINSDIR\PIMETextService_arm64x.dll" "..\build_arm64\PIMETextService\Release\PIMETextService.dll" - File "/oname=$PLUGINSDIR\PIMELauncher.exe" "..\build\PIMELauncher\PIMELauncher.exe" StrCpy $INST_PYTHON "False" StrCpy $INST_CINBASE "False" @@ -317,8 +293,14 @@ Section $(SECTION_MAIN) SecMain ; Install backend informations File "..\backends.json" + ; Ensure any existing in-use binaries in $INSTDIR are safely cleared before writing + !insertmacro CleanOldBinaries + ${If} ${RebootFlag} + Call .onInstFailed + ${EndIf} + ; Install the launcher responsible to launch the backends - !insertmacro InstallOrSkip "$INSTDIR\PIMELauncher.exe" "$PLUGINSDIR\PIMELauncher.exe" + File "..\build\PIMELauncher\PIMELauncher.exe" SectionEnd SectionGroup /e $(PYTHON_SECTION_GROUP) python_section_group @@ -510,20 +492,23 @@ Section "" Register ; Install the text service dlls ${If} ${IsNativeAMD64} ; This is a 64-bit x86-64/x64 Windows system - !insertmacro InstallOrSkip "$INSTDIR\x64\PIMETextService.dll" "$PLUGINSDIR\PIMETextService_x64.dll" + SetOutPath "$INSTDIR\x64" + File "..\build64\PIMETextService\Release\PIMETextService.dll" !insertmacro RegisterTextService 64 "$INSTDIR\x64\PIMETextService.dll" ${ElseIf} ${IsNativeARM64} ; This is a native ARM64 Windows system - ; ARM64X forwarder DLL - !insertmacro InstallOrSkip "$INSTDIR\arm64\PIMETextService.dll" "$PLUGINSDIR\PIMETextService_arm64x.dll" - ; Real native ARM64 DLL - !insertmacro InstallOrSkip "$INSTDIR\arm64\PIMETextService_arm64.dll" "$PLUGINSDIR\PIMETextService_arm64.dll" - ; Real x64 DLL for emulated x64 / ARM64EC processes - !insertmacro InstallOrSkip "$INSTDIR\arm64\PIMETextService_x64.dll" "$PLUGINSDIR\PIMETextService_x64.dll" + SetOutPath "$INSTDIR\arm64" + ; ARM64X forwarder DLL (built in build_arm64\PIMETextService\Release\PIMETextService.dll) + File "..\build_arm64\PIMETextService\Release\PIMETextService.dll" + ; Real native ARM64 DLL (built in build_arm64\PIMETextService\Release\PIMETextService_arm64.dll) + File "..\build_arm64\PIMETextService\Release\PIMETextService_arm64.dll" + ; Real x64 DLL for emulated x64 / ARM64EC processes (built in build64\PIMETextService\Release\PIMETextService.dll) + File "/oname=PIMETextService_x64.dll" "..\build64\PIMETextService\Release\PIMETextService.dll" ; Register COM objects (only register the ARM64X forwarder DLL) !insertmacro RegisterTextService 64 "$INSTDIR\arm64\PIMETextService.dll" ${EndIf} - !insertmacro InstallOrSkip "$INSTDIR\x86\PIMETextService.dll" "$PLUGINSDIR\PIMETextService_x86.dll" + SetOutPath "$INSTDIR\x86" + File "..\build\PIMETextService\Release\PIMETextService.dll" !insertmacro RegisterTextService 32 "$INSTDIR\x86\PIMETextService.dll" ; Launch the python server on startup @@ -603,7 +588,6 @@ Section "Uninstall" ; Try to terminate running PIMELauncher and the server process !insertmacro StopPIMELauncher - !insertmacro SafeDeleteFile "$INSTDIR\PIMELauncher.exe" ; Unregister COM objects (NSIS UnRegDLL command is broken and cannot be used) !insertmacro UnregisterTextService 32 "$INSTDIR\x86\PIMETextService.dll" @@ -619,20 +603,15 @@ Section "Uninstall" ; Remove auto-start, uninstall, and product keys from registry !insertmacro CleanPIMERegistry - ; Safely delete text service DLLs (which may be locked by running processes) - !insertmacro SafeDeleteFile "$INSTDIR\x86\PIMETextService.dll" + ; Safely delete binaries (which may be locked by running processes) + !insertmacro CleanOldBinaries RMDir /REBOOTOK "$INSTDIR\x86" ${If} ${IsNativeAMD64} - !insertmacro SafeDeleteFile "$INSTDIR\x64\PIMETextService.dll" RMDir /REBOOTOK "$INSTDIR\x64" ${ElseIf} ${IsNativeARM64} - !insertmacro SafeDeleteFile "$INSTDIR\arm64\PIMETextService.dll" - !insertmacro SafeDeleteFile "$INSTDIR\arm64\PIMETextService_arm64.dll" - !insertmacro SafeDeleteFile "$INSTDIR\arm64\PIMETextService_x64.dll" RMDir /REBOOTOK "$INSTDIR\arm64" ${If} ${FileExists} "$INSTDIR\x64" - !insertmacro SafeDeleteFile "$INSTDIR\x64\PIMETextService.dll" RMDir /REBOOTOK "$INSTDIR\x64" ${EndIf} ${EndIf} diff --git a/installer/macros.nsh b/installer/macros.nsh index 2806368d3..9e5e959eb 100644 --- a/installer/macros.nsh +++ b/installer/macros.nsh @@ -1,4 +1,4 @@ -; NOTE: This file MUST be saved as UTF-8 with BOM (utf-8-sig) so that +; NOTE: This file MUST be saved as UTF-8 with BOM (utf-8-sig) so that ; NSIS (makensis) natively detects Unicode strings without breaking Git diffs. ; Do NOT convert this file to UTF-16. ; @@ -28,50 +28,6 @@ !define PIME_INSTALLER_MACROS_NSH -; ============================================================================== -; Macro: CheckFileMD5Equal -; ------------------------------------------------------------------------------ -; Compares the MD5 checksums of two files using the md5dll plugin. -; -; Parameters: -; FILE_A - Full path to first file. -; FILE_B - Full path to second file. -; OUT_VAR - Variable to store result: "True" if both files exist and have -; matching checksums; "False" otherwise. -; ============================================================================== -!macro CheckFileMD5Equal FILE_A FILE_B OUT_VAR - Push $R0 - Push $R1 - - !define md5A $R0 - !define md5B $R1 - !define isMatch $R1 ; reuse R1 for result - - StrCpy ${isMatch} "False" - ${If} ${FileExists} "${FILE_A}" - ${AndIf} ${FileExists} "${FILE_B}" - md5dll::GetMD5File "${FILE_A}" - Pop ${md5A} - md5dll::GetMD5File "${FILE_B}" - Pop ${md5B} - ${If} ${md5A} == ${md5B} - StrCpy ${isMatch} "True" - ${EndIf} - ${EndIf} - - Push ${isMatch} ; push result onto stack - - !undef md5A - !undef md5B - !undef isMatch - - Exch 2 - Pop $R0 - Pop $R1 - Pop ${OUT_VAR} -!macroend - - ; ============================================================================== ; Macro: SafeDeleteFile ; ------------------------------------------------------------------------------ @@ -84,9 +40,10 @@ ; - Generates a unique temporary filename in the same directory. ; - Attempts to rename TARGET_FILE to this unique temporary file. ; - If rename succeeds: schedules only the temporary file for deletion on -; reboot using Delete /REBOOTOK. +; reboot using Delete /REBOOTOK, and restores RebootFlag if no reboot was +; previously pending (as the destination path is now free for writing). ; - If rename fails (hard lock): schedules original TARGET_FILE on reboot -; and sets RebootFlag. +; and sets RebootFlag true. ; ; Parameters: ; TARGET_FILE - Path to file to delete. @@ -94,9 +51,17 @@ !macro SafeDeleteFile TARGET_FILE Push $R0 Push $R1 + Push $R2 !define sdf_tempDeletedFile $R0 !define sdf_targetDir $R1 + !define sdf_priorRebootFlag $R2 + + ; Save pre-existing RebootFlag state so we don't accidentally clear a reboot requested earlier + StrCpy ${sdf_priorRebootFlag} "0" + ${If} ${RebootFlag} + StrCpy ${sdf_priorRebootFlag} "1" + ${EndIf} ${If} ${FileExists} "${TARGET_FILE}" ClearErrors @@ -115,8 +80,14 @@ ${IfNot} ${Errors} ; Renamed: schedule only the unique file for deletion on reboot Delete /REBOOTOK "${sdf_tempDeletedFile}" + ; Delete /REBOOTOK sets RebootFlag internally. Since rename succeeded, + ; the destination path is now vacant and can be replaced immediately + ; without rebooting. Restore prior RebootFlag state. + ${If} ${sdf_priorRebootFlag} == "0" + SetRebootFlag false + ${EndIf} ${Else} - ; Hard-locked: schedule original target on reboot + ; Hard-locked: schedule original target on reboot and flag reboot requirement Delete /REBOOTOK "${TARGET_FILE}" SetRebootFlag true ${EndIf} @@ -125,97 +96,38 @@ !undef sdf_tempDeletedFile !undef sdf_targetDir + !undef sdf_priorRebootFlag + Pop $R2 Pop $R1 Pop $R0 !macroend ; ============================================================================== -; Macro: InstallOrSkip +; Macro: CleanOldBinaries ; ------------------------------------------------------------------------------ -; Installs a binary file (DLL / EXE) to a destination path, skipping the write -; if the target file already exists and has identical MD5 checksum. -; -; Expected Behavior: -; 1. Fast path: attempts direct CopyFiles. If target is not locked, this succeeds -; immediately with 0 hash calculations. -; 2. Target is locked: calculates MD5 of both target and source. -; 3. If MD5 matches: cleanly skips overwriting the file. -; 4. If MD5 differs: calls SafeDeleteFile to safely rename the locked target -; to a unique .deleted file, freeing the destination path so the new -; file can be copied directly without requiring a reboot. -; 5. If SafeDeleteFile hit a hard lock (rename failed): fails cleanly and prompts -; user to restart the computer. +; Safely removes or renames all PIME binary executables and DLLs in INSTDIR. +; If files are locked by running applications, renames them to temporary files +; and schedules them for deletion on reboot, freeing destination paths so new +; files can be installed immediately. ; ; Parameters: -; TARGET_FILE - Destination file path (e.g. "$INSTDIR\x86\PIMETextService.dll"). -; SOURCE_FILE - Source candidate file (e.g. "$PLUGINSDIR\PIMETextService_x86.dll"). +; None (operates on $INSTDIR, RunningX64, IsNativeARM64). ; ============================================================================== -!macro InstallOrSkip TARGET_FILE SOURCE_FILE - Push $R0 - Push $R1 - Push $R2 - - !define ios_isMD5Equal $R0 - !define ios_targetDir $R1 - !define ios_priorRebootFlag $R2 - - ; Save pre-existing RebootFlag state so we don't accidentally clear a reboot requested earlier - StrCpy ${ios_priorRebootFlag} "0" - ${If} ${RebootFlag} - StrCpy ${ios_priorRebootFlag} "1" - ${EndIf} - - ; Ensure parent directory exists - GetFullPathName ${ios_targetDir} "${TARGET_FILE}\.." - CreateDirectory "${ios_targetDir}" - - ; 1. Try unconditional write first (succeeds if file is new or not in use) - ClearErrors - CopyFiles /SILENT "${SOURCE_FILE}" "${TARGET_FILE}" - ${If} ${Errors} - ; 2. Write failed: target is locked / in use. - ; Check MD5: if identical, we don't need to overwrite it! Skip cleanly. - !insertmacro CheckFileMD5Equal "${TARGET_FILE}" "${SOURCE_FILE}" ${ios_isMD5Equal} - ${If} ${ios_isMD5Equal} != "True" - ; 3. Target is locked and MD5 differs: safely remove/rename the old file - !insertmacro SafeDeleteFile "${TARGET_FILE}" - ${IfNot} ${FileExists} "${TARGET_FILE}" - ; Rename succeeded: path is now freed on disk, copy new file into place - ClearErrors - CopyFiles /SILENT "${SOURCE_FILE}" "${TARGET_FILE}" - ${If} ${Errors} - ; Target write failed even after path was freed - SetRebootFlag true - MessageBox MB_YESNO|MB_ICONSTOP $(REBOOT_QUESTION) IDNO +2 - Reboot - Quit - ${Else} - ; Successfully replaced in place. - ; Delete /REBOOTOK on the renamed temporary file sets NSIS RebootFlag - ; internally. If no reboot was requested before this macro ran, clear - ; the flag so we don't prompt the user for an unnecessary reboot. - ${If} ${ios_priorRebootFlag} == "0" - SetRebootFlag false - ${EndIf} - ${EndIf} - ${Else} - ; 4. Hard lock: rename failed, cannot replace target without reboot. - MessageBox MB_YESNO|MB_ICONSTOP $(REBOOT_QUESTION) IDNO +2 - Reboot - Quit - ${EndIf} +!macro CleanOldBinaries + !insertmacro SafeDeleteFile "$INSTDIR\PIMELauncher.exe" + !insertmacro SafeDeleteFile "$INSTDIR\x86\PIMETextService.dll" + ${If} ${IsNativeAMD64} + !insertmacro SafeDeleteFile "$INSTDIR\x64\PIMETextService.dll" + ${ElseIf} ${IsNativeARM64} + !insertmacro SafeDeleteFile "$INSTDIR\arm64\PIMETextService.dll" + !insertmacro SafeDeleteFile "$INSTDIR\arm64\PIMETextService_arm64.dll" + !insertmacro SafeDeleteFile "$INSTDIR\arm64\PIMETextService_x64.dll" + ${If} ${FileExists} "$INSTDIR\x64\PIMETextService.dll" + !insertmacro SafeDeleteFile "$INSTDIR\x64\PIMETextService.dll" ${EndIf} ${EndIf} - - !undef ios_isMD5Equal - !undef ios_targetDir - !undef ios_priorRebootFlag - - Pop $R2 - Pop $R1 - Pop $R0 !macroend diff --git a/installer/md5dll/ANSI/md5dll.dll b/installer/md5dll/ANSI/md5dll.dll deleted file mode 100644 index 003e16378bbadfda487e4d473280cc9c57cb179c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6656 zcmeHMdstJ)wx5td0tpZl0Ut;t)CX9MMMcCaZ?%F1P!JFyLV!RZoFqWGB4Q&d##DNI zR&9N>_C?iNH9q|eP``8UANStxJNJ*Sd~0Ubn%}Hh zvu4d^?;#+f01**FBw!3fs0eDDJoM#%Uo=3sncXEbbl&*Zv?7B4t!b+hc_K!dP>>+x zq%dMRsi^`nV*{5VOiyL-QW-vhA&eA39M{>@)WqSf>8vBqG#?L33rBfpAq(W_#|H}+ zLOrCF6)uLF*LU043fB1l>R&=;e3y8_^*TAqD`}Zbj%O4$Fo1pGI)S z8}iwX5bd4te^{?!uVv}Y#Xza|59;^k&qb&eaC4#O4JHk0GvN1d9)NQeiiEMyrMHy} zH3fJa@EGzysC10@ck};81YDe1^APOwG*e>(lk}D~pDpkgY&;N*P_GF%$Uta1q;h}r z2!@FrNJ$>p1bmarCD}A2HW_b`(bTn+R4(;#poD&7!tgM*q|9F4)_*^RUShG_)IYS{ z5Jg9o+V}F^^2J@KN35NMv1+O;|tS1tjyF>%;h8_ zj&I-k#lgb~H5X|Xna<;F{3Ijv?3yL2hi9GywA)%YXc(dFF!zC%VCRS9Uxe2*8wezCw#@Jh*70c5|b|GO!+Kv1I z7Z=sVtdPW9P7*Ohl$;ti{S35=Cgiz^xGY5}hY)Q5*BvZ{*>|)<^c2WI?^gEw<%gdWj++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/installer/md5dll/MD5.cpp b/installer/md5dll/MD5.cpp deleted file mode 100644 index 588ae6c21..000000000 --- a/installer/md5dll/MD5.cpp +++ /dev/null @@ -1,367 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// MD5.cpp -// Implementation file for MD5 class -// -// This C++ Class implementation of the original RSA Data Security, Inc. -// MD5 Message-Digest Algorithm is copyright (c) 2002, Gary McNickle. -// All rights reserved. This software is a derivative of the "RSA Data -// Security, Inc. MD5 Message-Digest Algorithm" -// -// You may use this software free of any charge, but without any -// warranty or implied warranty, provided that you follow the terms -// of the original RSA copyright, listed below. -// -// Original RSA Data Security, Inc. Copyright notice -///////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -// rights reserved. -// -// License to copy and use this software is granted provided that it -// is identified as the "RSA Data Security, Inc. MD5 Message-Digest -// Algorithm" in all material mentioning or referencing this software -// or this function. -// License is also granted to make and use derivative works provided -// that such works are identified as "derived from the RSA Data -// Security, Inc. MD5 Message-Digest Algorithm" in all material -// mentioning or referencing the derived work. -// RSA Data Security, Inc. makes no representations concerning either -// the merchantability of this software or the suitability of this -// software for any particular purpose. It is provided "as is" -// without express or implied warranty of any kind. -// These notices must be retained in any copies of any part of this -// documentation and/or software. -///////////////////////////////////////////////////////////////////////// - -#if 0 -#include -#include -#include -#include -#else -#define WIN32_LEAN_AND_MEAN -#include -#endif -#include "md5.h" - - -static unsigned char PADDING[64] = -{ - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - - -// local version of memcpy -static void *lmemcpy(void *dest, const void *source, uint4 count) -{ - register char *dst=(char *)dest; - register char *src=(char *)source; - while (count--) - { - *dst = *src; - dst++; - src++; - } - return dest; -} - - -// PrintMD5: Converts a completed md5 digest into a char* string. -char* PrintMD5(uchar md5Digest[16]) -{ - char chBuffer[256]; - char chEach[10]; - int nCount; - - register int i; - //memset(chBuffer,0,256); - for (i = 0; i < 64; i++) ((uint4 *)chBuffer)[i] = 0UL; - //memset(chEach, 0, 10); - for (i = 0; i < 10; i++) chEach[i] = 0; - - for (nCount = 0; nCount < 16; nCount++) - { - wsprintf(chEach, "%02x", md5Digest[nCount]); - lstrcat(chBuffer, chEach /*, sizeof(chEach)*/); - } - - char *Tmp = new char[256]; - lstrcpyn(Tmp,chBuffer,256); Tmp[255]='0'; - return Tmp; - //return strdup(chBuffer); -} - -#if defined(ENABLE_GETMD5STRING) || defined (ENABLE_GETMD5RANDOM) -// MD5String: Performs the MD5 algorithm on a char* string, returning -// the results as a char*. -char* MD5String(char* szString) -{ - int nLen = lstrlen(szString); - md5 alg; - - alg.Update((unsigned char*)szString, (unsigned int)nLen); - alg.Finalize(); - - return PrintMD5(alg.Digest()); - -} -#endif - -#if defined(ENABLE_GETMD5FILE) -// MD5File: Performs the MD5 algorithm on a file (binar or text), -// returning the results as a char*. Returns NULL if it fails. -char* MD5File(char* szFilename) -{ - HANDLE file; - md5 alg; - unsigned long nLen; - unsigned char chBuffer[1024]; - -// try - { - //memset(chBuffer, 0, 1024); - for (register int i = 0; i < 256; i++) ((uint4 *)chBuffer)[i] = 0UL; - - if ((file = CreateFile(szFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE ) - { - while ((ReadFile(file, chBuffer, 1024, &nLen, NULL) != FALSE) && nLen) - alg.Update(chBuffer, nLen); - - alg.Finalize(); - - CloseHandle(file); - - return PrintMD5(alg.Digest()); - } - } -// catch(...) - { - - } - - return NULL; // failed -} -#endif - - -// md5::Init -// Initializes a new context. -void md5::Init() -{ - //memset(m_Count, 0, 2 * sizeof(uint4)); - m_Count[0] = m_Count[1] = 0; - - m_State[0] = 0x67452301; - m_State[1] = 0xefcdab89; - m_State[2] = 0x98badcfe; - m_State[3] = 0x10325476; -} - -// md5::Update -// MD5 block update operation. Continues an MD5 message-digest -// operation, processing another message block, and updating the -// context. -void md5::Update(uchar* chInput, uint4 nInputLen) -{ - uint4 i, index, partLen; - - // Compute number of bytes mod 64 - index = (unsigned int)((m_Count[0] >> 3) & 0x3F); - - // Update number of bits - if ((m_Count[0] += (nInputLen << 3)) < (nInputLen << 3)) - m_Count[1]++; - - m_Count[1] += (nInputLen >> 29); - - partLen = 64 - index; - - // Transform as many times as possible. - if (nInputLen >= partLen) - { - lmemcpy( &m_Buffer[index], chInput, partLen ); - Transform(m_Buffer); - - for (i = partLen; i + 63 < nInputLen; i += 64) - Transform(&chInput[i]); - - index = 0; - } - else - i = 0; - - // Buffer remaining input - lmemcpy( &m_Buffer[index], &chInput[i], nInputLen-i ); -} - -// md5::Finalize -// MD5 finalization. Ends an MD5 message-digest operation, writing -// the message digest and zeroizing the context. -void md5::Finalize() -{ - uchar bits[8]; - uint4 index, padLen; - - // Save number of bits - Encode (bits, m_Count, 8); - - // Pad out to 56 mod 64 - index = (unsigned int)((m_Count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - Update(PADDING, padLen); - - // Append length (before padding) - Update (bits, 8); - - // Store state in digest - Encode (m_Digest, m_State, 16); - - //memset(m_Count, 0, 2 * sizeof(uint4)); - m_Count[0] = m_Count[1] = 0; - //memset(m_State, 0, 4 * sizeof(uint4)); - m_State[0] = m_State[1] = m_State[2] = m_State[3] = 0; - //memset(m_Buffer,0, 64 * sizeof(uchar)); - for (register int i = 0; i < 16; i++) ((uint4 *)m_Buffer)[i] = 0UL; -} - -// md5::Transform -// MD5 basic transformation. Transforms state based on block. -void md5::Transform (uchar* block) -{ - uint4 a = m_State[0], b = m_State[1], c = m_State[2], d = m_State[3], x[16]; - - Decode (x, block, 64); - - // Round 1 - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); - FF (c, d, a, b, x[ 2], S13, 0x242070db); - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); - FF (c, d, a, b, x[ 6], S13, 0xa8304613); - FF (b, c, d, a, x[ 7], S14, 0xfd469501); - FF (a, b, c, d, x[ 8], S11, 0x698098d8); - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); - FF (c, d, a, b, x[10], S13, 0xffff5bb1); - FF (b, c, d, a, x[11], S14, 0x895cd7be); - FF (a, b, c, d, x[12], S11, 0x6b901122); - FF (d, a, b, c, x[13], S12, 0xfd987193); - FF (c, d, a, b, x[14], S13, 0xa679438e); - FF (b, c, d, a, x[15], S14, 0x49b40821); - - // Round 2 - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); - GG (d, a, b, c, x[ 6], S22, 0xc040b340); - GG (c, d, a, b, x[11], S23, 0x265e5a51); - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); - GG (d, a, b, c, x[10], S22, 0x2441453); - GG (c, d, a, b, x[15], S23, 0xd8a1e681); - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); - GG (d, a, b, c, x[14], S22, 0xc33707d6); - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); - GG (a, b, c, d, x[13], S21, 0xa9e3e905); - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); - - // Round 3 - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); - HH (d, a, b, c, x[ 8], S32, 0x8771f681); - HH (c, d, a, b, x[11], S33, 0x6d9d6122); - HH (b, c, d, a, x[14], S34, 0xfde5380c); - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); - HH (b, c, d, a, x[10], S34, 0xbebfbc70); - HH (a, b, c, d, x[13], S31, 0x289b7ec6); - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); - HH (b, c, d, a, x[ 6], S34, 0x4881d05); - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); - HH (d, a, b, c, x[12], S32, 0xe6db99e5); - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); - - // Round 4 - II (a, b, c, d, x[ 0], S41, 0xf4292244); - II (d, a, b, c, x[ 7], S42, 0x432aff97); - II (c, d, a, b, x[14], S43, 0xab9423a7); - II (b, c, d, a, x[ 5], S44, 0xfc93a039); - II (a, b, c, d, x[12], S41, 0x655b59c3); - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); - II (c, d, a, b, x[10], S43, 0xffeff47d); - II (b, c, d, a, x[ 1], S44, 0x85845dd1); - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); - II (c, d, a, b, x[ 6], S43, 0xa3014314); - II (b, c, d, a, x[13], S44, 0x4e0811a1); - II (a, b, c, d, x[ 4], S41, 0xf7537e82); - II (d, a, b, c, x[11], S42, 0xbd3af235); - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); - II (b, c, d, a, x[ 9], S44, 0xeb86d391); - - m_State[0] += a; - m_State[1] += b; - m_State[2] += c; - m_State[3] += d; - - //memset(x, 0, sizeof(x)); - for (register int i = 0; i < (sizeof(x)/sizeof(*x)); i++) x[i] = 0UL; -} - -// md5::Encode -// Encodes input (uint4) into output (uchar). Assumes nLength is -// a multiple of 4. -void md5::Encode(uchar* dest, uint4* src, uint4 nLength) -{ - uint4 i, j; - - //assert(nLength % 4 == 0); - - for (i = 0, j = 0; j < nLength; i++, j += 4) - { - dest[j] = (uchar)(src[i] & 0xff); - dest[j+1] = (uchar)((src[i] >> 8) & 0xff); - dest[j+2] = (uchar)((src[i] >> 16) & 0xff); - dest[j+3] = (uchar)((src[i] >> 24) & 0xff); - } -} - -// md5::Decode -// Decodes input (uchar) into output (uint4). Assumes nLength is -// a multiple of 4. -void md5::Decode(uint4* dest, uchar* src, uint4 nLength) -{ - uint4 i, j; - - //assert(nLength % 4 == 0); - - for (i = 0, j = 0; j < nLength; i++, j += 4) - { - dest[i] = ((uint4)src[j]) | (((uint4)src[j+1])<<8) | - (((uint4)src[j+2])<<16) | (((uint4)src[j+3])<<24); - } -} \ No newline at end of file diff --git a/installer/md5dll/MD5.h b/installer/md5dll/MD5.h deleted file mode 100644 index 592ae048d..000000000 --- a/installer/md5dll/MD5.h +++ /dev/null @@ -1,100 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// MD5.cpp -// Implementation file for MD5 class -// -// This C++ Class implementation of the original RSA Data Security, Inc. -// MD5 Message-Digest Algorithm is copyright (c) 2002, Gary McNickle. -// All rights reserved. This software is a derivative of the "RSA Data -// Security, Inc. MD5 Message-Digest Algorithm" -// -// You may use this software free of any charge, but without any -// warranty or implied warranty, provided that you follow the terms -// of the original RSA copyright, listed below. -// -// Original RSA Data Security, Inc. Copyright notice -///////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -// rights reserved. -// -// License to copy and use this software is granted provided that it -// is identified as the "RSA Data Security, Inc. MD5 Message-Digest -// Algorithm" in all material mentioning or referencing this software -// or this function. -// License is also granted to make and use derivative works provided -// that such works are identified as "derived from the RSA Data -// Security, Inc. MD5 Message-Digest Algorithm" in all material -// mentioning or referencing the derived work. -// RSA Data Security, Inc. makes no representations concerning either -// the merchantability of this software or the suitability of this -// software for any particular purpose. It is provided "as is" -// without express or implied warranty of any kind. -// These notices must be retained in any copies of any part of this -// documentation and/or software. -///////////////////////////////////////////////////////////////////////// - -typedef unsigned int uint4; -typedef unsigned short int uint2; -typedef unsigned char uchar; - -char* PrintMD5(uchar md5Digest[16]); -#if defined(ENABLE_GETMD5STRING) || defined (ENABLE_GETMD5RANDOM) -char* MD5String(char* szString); -#endif -#if defined(ENABLE_GETMD5FILE) -char* MD5File(char* szFilename); -#endif - -class md5 -{ -// Methods -public: - md5() { Init(); } - void Init(); - void Update(uchar* chInput, uint4 nInputLen); - void Finalize(); - uchar* Digest() { return m_Digest; } - -private: - - void Transform(uchar* block); - void Encode(uchar* dest, uint4* src, uint4 nLength); - void Decode(uint4* dest, uchar* src, uint4 nLength); - - - inline uint4 rotate_left(uint4 x, uint4 n) - { return ((x << n) | (x >> (32-n))); } - - inline uint4 F(uint4 x, uint4 y, uint4 z) - { return ((x & y) | (~x & z)); } - - inline uint4 G(uint4 x, uint4 y, uint4 z) - { return ((x & z) | (y & ~z)); } - - inline uint4 H(uint4 x, uint4 y, uint4 z) - { return (x ^ y ^ z); } - - inline uint4 I(uint4 x, uint4 y, uint4 z) - { return (y ^ (x | ~z)); } - - inline void FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) - { a += F(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } - - inline void GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) - { a += G(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } - - inline void HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) - { a += H(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } - - inline void II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) - { a += I(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } - -// Data -private: - uint4 m_State[4]; - uint4 m_Count[2]; - uchar m_Buffer[64]; - uchar m_Digest[16]; - uchar m_Finalized; - -}; \ No newline at end of file diff --git a/installer/md5dll/MD5Example.nsi b/installer/md5dll/MD5Example.nsi deleted file mode 100644 index 65d0f1232..000000000 --- a/installer/md5dll/MD5Example.nsi +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************** - *** Generates a md5 value from a file, string or random. *** - **************************************************************/ - -Name "MD5dll Example" -OutFile "MD5dllTest.exe" -ShowInstDetails show - -Section - # generate MD5sum of file - StrCpy $0 "${NSISDIR}\NSIS.CHM" - md5dll::GetMD5File "$0" - Pop $1 - - DetailPrint 'md5dll::GetMD5File "$0"' - DetailPrint "MD5: [$1]" - DetailPrint "" - - # generate MD5sum of file using deprecated method - StrCpy $0 "${NSISDIR}\NSIS.CHM" - md5dll::GetFileMD5 "$0" - Pop $1 - - DetailPrint '{deprecated} md5dll::GetFileMD5 "$0"' - DetailPrint "MD5: [$1]" - DetailPrint "" - - - #generate MD5sum of string - StrCpy $0 "MyString" - md5dll::GetMD5String "$0" - Pop $1 - - DetailPrint 'md5dll::GetMD5String "$0"' - DetailPrint "MD5: [$1]" - DetailPrint "" - - #generate MD5sum of string using deprecated method - StrCpy $0 "MyString" - md5dll::GetMD5 "$0" - Pop $1 - - DetailPrint '{deprecated} md5dll::GetMD5 "$0"' - DetailPrint "MD5: [$1]" - DetailPrint "" - - - #generate random MD5sum - md5dll::GetMD5Random - Pop $1 - - DetailPrint "md5dll::GetMD5Random" - DetailPrint "MD5: [$1]" - DetailPrint "" -SectionEnd diff --git a/installer/md5dll/UNICODE/md5dll.dll b/installer/md5dll/UNICODE/md5dll.dll deleted file mode 100644 index bde153f702f0d6c251d2b7ad7787fe950fd1725f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6656 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Po^7-p&yMXffd5`gVkfoPZtCJWZ_}kPhI9ni3g{p(p&l z%_tFObpjT`kD#+qR}%6AY@7y3R5=-HKtvG-QAhz3qwyp_semBzN(Gq>xL9b3J>mhq zm&O(iqd>3{RezmFItE;0M=KyBV!y_K?RAX_ zy9neI$V~c9h5zms;INO0HT*mN{gr%w9bd0|Agl#ZO@StZcVh^K8CSvD1wiHCC>2^F z<`7LCCNm|f{`$^B$VPLszphvk)ams-@pd2S((>MU8o;?SoR1y>ewY3LIqyB)q`e;W z_ko`SPXIIEoRuK+H~nhwb!)u+I13%T{QOXGp!Yf$#t4Z$=qHMf@e^zoM~l-v5Q29Y zu2{tLh=~#NC9s?!00Bm;Q5{T`g}japlugin_api_version -// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x)) -// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {} - -#define NSISPIAPIVER_1_0 0x00010000 -#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0 - -// NSIS Plug-In Callback Messages -enum NSPIM -{ - NSPIM_UNLOAD, // This is the last message a plugin gets, do final cleanup - NSPIM_GUIUNLOAD, // Called after .onGUIEnd -}; - -// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback() -// Return NULL for unknown messages -// Should always be __cdecl for future expansion possibilities -typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM); - -// extra_parameters data structures containing other interesting stuff -// but the stack, variables and HWND passed on to plug-ins. -typedef struct -{ - int autoclose; - int all_user_var; - int exec_error; - int abort; - int exec_reboot; // NSIS_SUPPORT_REBOOT - int reboot_called; // NSIS_SUPPORT_REBOOT - int XXX_cur_insttype; // depreacted - int plugin_api_version; // see NSISPIAPIVER_CURR - // used to be XXX_insttype_changed - int silent; // NSIS_CONFIG_SILENT_SUPPORT - int instdir_error; - int rtl; - int errlvl; - int alter_reg_view; - int status_update; -} exec_flags_t; - -#ifndef NSISCALL -# define NSISCALL __stdcall -#endif - -typedef struct { - exec_flags_t *exec_flags; - int (NSISCALL *ExecuteCodeSegment)(int, HWND); - void (NSISCALL *validate_filename)(TCHAR *); - int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors -} extra_parameters; - -// Definitions for page showing plug-ins -// See Ui.c to understand better how they're used - -// sent to the outer window to tell it to go to the next inner window -#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8) - -// custom pages should send this message to let NSIS know they're ready -#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd) - -// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning -#define NOTIFY_BYE_BYE 'x' - -#endif /* _PLUGIN_H_ */ diff --git a/installer/md5dll/build.bat b/installer/md5dll/build.bat deleted file mode 100644 index c20bb1f32..000000000 --- a/installer/md5dll/build.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo Building MD5dll -@set md5unicode= -@if not "%1"=="/u" goto skipU -@set md5unicode=/DNSIS_UNICODE -@:skipU -@REM compile dll -rc /l 0x409 /d "NDEBUG" %md5unicode% md5dll.rc -cl /O2 /GX- /Gs- /Oi /Os /GF /GB /DENABLE_GETMD5FILE /DENABLE_GETMD5STRING /DENABLE_GETMD5RANDOM %md5unicode% md5dll.def md5dll.res md5dll.cpp MD5.cpp kernel32.lib user32.lib /LD /link -opt:nowin98 -opt:REF,ICF -machine:I386 -nodefaultlib -entry:"_DllMainCRTStartup" -::@REM build optional link lib -::lib /DEF:md5dll.def /machine:I386 -@REM removing unneeded files -del *.obj -del md5dll.res -del md5dll.exp -del md5dll.lib -@set md5unicode= -@PAUSE diff --git a/installer/md5dll/md5dll.cpp b/installer/md5dll/md5dll.cpp deleted file mode 100644 index 4c3876ca6..000000000 --- a/installer/md5dll/md5dll.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// MD5 plugin. -// Be sure to add the RSA license notice somewhere in your installer. -// -// Matthew "IGx89" Lieder -// Author -// -// KJD -// -modified to reduce size and use exdll.h -// (reduced to about 6KB uncompressed, by removing CRTL dependency) -// -// Davy Durham -// -MD5.cpp fix (correct for loop used to replace memset, exceeded bounds) -// -// Shengalts Aleksander aka Instructor -// -New command: "GetMD5Random" -// -Changed names: "GetFileMD5" -> "GetMD5File", "GetMD5" -> "GetMD5String" -// -Fixed: string lenght error -// -// KJD -// -added dual exports for compatibility with prior versions -// -// KJD -// -updated Exdll.h to pluginapi.h, enable building for NSIS & Unicode NSIS - - -#ifdef NSIS_UNICODE /* MD5.cpp should be compiled in ANSI mode */ -#define UNICODE -#define _UNICODE -#endif - - -#define WIN32_LEAN_AND_MEAN -#include -#include "MD5.h" - -unsigned char staticCnvBuffer[1024*2]; -#ifdef UNICODE -#define wcslen lstrlenW -#define wcscpy lstrcpyW -#define wcsncpy lstrcpynW -#define wcscat lstrcatW -#define wcscmp lstrcmpW -#define wcscmpi lstrcmpiW -char * _T2A(unsigned short *wideStr) -{ - WideCharToMultiByte(CP_ACP, 0, wideStr, -1, (char *)staticCnvBuffer, sizeof(staticCnvBuffer), NULL, NULL); - return (char *)staticCnvBuffer; -} -#define _A2T(x) _A2U(x) -#else -#define strlen lstrlenA -#define strcpy lstrcpyA -#define strncpy lstrcpynA -#define strcat lstrcatA -#define strcmp lstrcmpA -#define strcmpi lstrcmpiA -#define _T2A(x) (x) -#define _A2T(x) (x) -#endif -unsigned short * _A2U(char *ansiStr) -{ - MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, (unsigned short *)staticCnvBuffer, sizeof(staticCnvBuffer)/2); - return (unsigned short *)staticCnvBuffer; -} - -#include "pluginapi.h" - - -void *operator new( unsigned int num_bytes ) -{ - return GlobalAlloc(GPTR,num_bytes); -} -void operator delete( void *p ) { if (p) GlobalFree(p); } - - -/* buffer for retrieving arguments from NSIS's stack into, outside func to avoid calls to __stkchk */ -TCHAR strarg[1024*sizeof(TCHAR)]; - -#ifdef ENABLE_GETMD5FILE -extern "C" void __declspec( dllexport ) GetMD5File(HWND hwndParent, int string_size, - TCHAR *variables, stack_t **stacktop) -{ - EXDLL_INIT(); - - // generate MD5sum of file - { - char *buf=NULL; - - popstring(strarg); - buf = MD5File(_T2A(strarg)); - pushstring(_A2T(buf)); - delete buf; - } -} -#endif // ENABLE_GETMD5FILE - -#ifdef ENABLE_GETMD5STRING -extern "C" void __declspec( dllexport ) GetMD5String(HWND hwndParent, int string_size, - TCHAR *variables, stack_t **stacktop) -{ - EXDLL_INIT(); - - // generate MD5sum of string - { - char *buf=NULL; - - popstring(strarg); - buf = MD5String(_T2A(strarg)); - pushstring(_A2T(buf)); - delete buf; - } -} -#endif // ENABLE_GETMD5STRING - -#ifdef ENABLE_GETMD5RANDOM -extern "C" void __declspec( dllexport ) GetMD5Random(HWND hwndParent, int string_size, - TCHAR *variables, stack_t **stacktop) -{ - EXDLL_INIT(); - - // generate random MD5sum - { - DWORD dwTickCount=0; - char lTickCount[1024]; - char *buf=NULL; - - Sleep(1); - dwTickCount=GetTickCount(); - wsprintfA(lTickCount,"%d",dwTickCount); - buf = MD5String(lTickCount); - pushstring(_A2T(buf)); - delete buf; - } -} -#endif // ENABLE_GETMD5RANDOM - -extern "C" BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) -{ - return TRUE; -} diff --git a/installer/md5dll/md5dll.def b/installer/md5dll/md5dll.def deleted file mode 100644 index 3eaae15bc..000000000 --- a/installer/md5dll/md5dll.def +++ /dev/null @@ -1,10 +0,0 @@ -LIBRARY MD5DLL -DESCRIPTION "Implements MD5 Sum as NSIS plugin" -EXPORTS -GetMD5File @1 -GetMD5String @2 -GetMD5Random @3 - -;These are for compatibility with older versions of this plugin only {deprecated} -GetFileMD5=GetMD5File @101 PRIVATE -GetMD5=GetMD5String @102 PRIVATE diff --git a/installer/md5dll/md5dll.rc b/installer/md5dll/md5dll.rc deleted file mode 100644 index a1cb8f72c..000000000 --- a/installer/md5dll/md5dll.rc +++ /dev/null @@ -1,100 +0,0 @@ -#include - -#define APP_ICON 100 - -#ifdef RC_INVOKED - -// Pretty icon displayed by Explorer -// APP_ICON ICON DISCARDABLE "md5dll.ico" - -// Version info viewable by Explorer -#define _VM 0 -#define _VN 5 -#define _VI 0 -#define _VB 0 - -#ifndef mk_str -#define mk_str2(x) # x -#define mk_str(x) mk_str2(x) -#endif - -#define _VS mk_str(_VM) "." mk_str(_VN) "." mk_str(_VI) "-" mk_str(_VB) "\0" - - -// normally found in included by -// FILEFLAGS -#define VS_FF_NORMAL 0x00000000L // ok I made this one up -#ifndef VS_FF_DEBUG -#define VS_FF_DEBUG 0x00000001L -#endif -#ifndef VS_FF_PRERELEASE -#define VS_FF_PRERELEASE 0x00000002L -#endif -// FILEOS -#ifndef VOS_NT -#define VOS_NT 0x00040000L -#endif -#ifndef VOS__WINDOWS32 -#define VOS__WINDOWS32 0x00000004L -#endif -#ifndef VOS_NT_WINDOWS32 -#define VOS_NT_WINDOWS32 0x00040004L -#endif -// FILETYPE -#ifndef VFT_APP -#define VFT_APP 0x00000001L -#endif -#ifndef VFT_DLL -#define VFT_DLL 0x00000002L -#endif - - -VS_VERSION_INFO VERSIONINFO - FILEVERSION _VM,_VN,_VI,_VB - PRODUCTVERSION _VM,_VN,_VI,_VB - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE // a debug build is never a release -#else - FILEFLAGS VS_FF_NORMAL -#endif - FILEOS VOS_NT_WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904b0" - BEGIN - VALUE "Comments", "NSIS plugin to calculate MD5 sum.\0" - VALUE "CompanyName", "www.fdos.org\0" - VALUE "FileDescription", "MD5 message digest algorithm\0" - VALUE "FileVersion", _VS - VALUE "InternalName", "md5dll\0" -// Only about the 1st 45+ characters are shown in Windows 2000 properties Version dialog - VALUE "LegalCopyright", "derivative of RSA Data Security, Inc. MD5 Message-Digest Algorithm\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "md5dll.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "md5dll\0" - VALUE "ProductVersion", _VS -#ifdef NSIS_UNICODE - VALUE "SpecialBuild", "UNICODE\0" -#else - VALUE "SpecialBuild", "ANSI\0" -#endif - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#undef _VM -#undef _VN -#undef _VI -#undef _VB -#undef _VS - -#endif diff --git a/installer/md5dll/nsis_tchar.h b/installer/md5dll/nsis_tchar.h deleted file mode 100644 index 92e989e31..000000000 --- a/installer/md5dll/nsis_tchar.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * nsis_tchar.h - * - * This file is a part of NSIS. - * - * Copyright (C) 1999-2007 Nullsoft and Contributors - * - * This software is provided 'as-is', without any express or implied - * warranty. - * - * For Unicode support by Jim Park -- 08/30/2007 - */ - -// Jim Park: Only those we use are listed here. - -#pragma once - -#ifdef _UNICODE - -#ifndef _T -#define __T(x) L ## x -#define _T(x) __T(x) -#define _TEXT(x) __T(x) -#endif -typedef wchar_t TCHAR; -typedef wchar_t _TUCHAR; - -// program -#define _tmain wmain -#define _tWinMain wWinMain -#define _tenviron _wenviron -#define __targv __wargv - -// printfs -#define _ftprintf fwprintf -#define _sntprintf _snwprintf -#define _stprintf _swprintf -#define _tprintf wprintf -#define _vftprintf vfwprintf -#define _vsntprintf _vsnwprintf -#define _vstprintf _vswprintf - -// scanfs -#define _tscanf wscanf -#define _stscanf swscanf - -// string manipulations -#define _tcscat wcscat -#define _tcschr wcschr -#define _tcsclen wcslen -#define _tcscpy wcscpy -#define _tcsdup _wcsdup -#define _tcslen wcslen -#define _tcsnccpy wcsncpy -#define _tcsncpy wcsncpy -#define _tcsrchr wcsrchr -#define _tcsstr wcsstr -#define _tcstok wcstok - -// string comparisons -#define _tcscmp wcscmp -#define _tcsicmp _wcsicmp -#define _tcsncicmp _wcsnicmp -#define _tcsncmp wcsncmp -#define _tcsnicmp _wcsnicmp - -// upper / lower -#define _tcslwr _wcslwr -#define _tcsupr _wcsupr -#define _totlower towlower -#define _totupper towupper - -// conversions to numbers -#define _tcstoi64 _wcstoi64 -#define _tcstol wcstol -#define _tcstoul wcstoul -#define _tstof _wtof -#define _tstoi _wtoi -#define _tstoi64 _wtoi64 -#define _ttoi _wtoi -#define _ttoi64 _wtoi64 -#define _ttol _wtol - -// conversion from numbers to strings -#define _itot _itow -#define _ltot _ltow -#define _i64tot _i64tow -#define _ui64tot _ui64tow - -// file manipulations -#define _tfopen _wfopen -#define _topen _wopen -#define _tremove _wremove -#define _tunlink _wunlink - -// reading and writing to i/o -#define _fgettc fgetwc -#define _fgetts fgetws -#define _fputts fputws -#define _gettchar getwchar - -// directory -#define _tchdir _wchdir - -// environment -#define _tgetenv _wgetenv -#define _tsystem _wsystem - -// time -#define _tcsftime wcsftime - -#else // ANSI - -#ifndef _T -#define _T(x) x -#define _TEXT(x) x -#endif -typedef char TCHAR; -typedef unsigned char _TUCHAR; - -// program -#define _tmain main -#define _tWinMain WinMain -#define _tenviron environ -#define __targv __argv - -// printfs -#define _ftprintf fprintf -#define _sntprintf _snprintf -#define _stprintf sprintf -#define _tprintf printf -#define _vftprintf vfprintf -#define _vsntprintf _vsnprintf -#define _vstprintf vsprintf - -// scanfs -#define _tscanf scanf -#define _stscanf sscanf - -// string manipulations -#define _tcscat strcat -#define _tcschr strchr -#define _tcsclen strlen -#define _tcscnlen strnlen -#define _tcscpy strcpy -#define _tcsdup _strdup -#define _tcslen strlen -#define _tcsnccpy strncpy -#define _tcsncpy strncpy -#define _tcsrchr strrchr -#define _tcsstr strstr -#define _tcstok strtok - -// string comparisons -#define _tcscmp strcmp -#define _tcsicmp _stricmp -#define _tcsncmp strncmp -#define _tcsncicmp _strnicmp -#define _tcsnicmp _strnicmp - -// upper / lower -#define _tcslwr _strlwr -#define _tcsupr _strupr - -#define _totupper toupper -#define _totlower tolower - -// conversions to numbers -#define _tcstol strtol -#define _tcstoul strtoul -#define _tstof atof -#define _tstoi atoi -#define _tstoi64 _atoi64 -#define _tstoi64 _atoi64 -#define _ttoi atoi -#define _ttoi64 _atoi64 -#define _ttol atol - -// conversion from numbers to strings -#define _i64tot _i64toa -#define _itot _itoa -#define _ltot _ltoa -#define _ui64tot _ui64toa - -// file manipulations -#define _tfopen fopen -#define _topen _open -#define _tremove remove -#define _tunlink _unlink - -// reading and writing to i/o -#define _fgettc fgetc -#define _fgetts fgets -#define _fputts fputs -#define _gettchar getchar - -// directory -#define _tchdir _chdir - -// environment -#define _tgetenv getenv -#define _tsystem system - -// time -#define _tcsftime strftime - -#endif - -// is functions (the same in Unicode / ANSI) -#define _istgraph isgraph -#define _istascii __isascii - -#define __TFILE__ _T(__FILE__) -#define __TDATE__ _T(__DATE__) -#define __TTIME__ _T(__TIME__) diff --git a/installer/md5dll/pluginapi.h b/installer/md5dll/pluginapi.h deleted file mode 100644 index 86dee2fb3..000000000 --- a/installer/md5dll/pluginapi.h +++ /dev/null @@ -1,103 +0,0 @@ -// only include this file from one place in your DLL. -// (it is all static, if you use it in two places it will fail) - -#ifndef ___NSIS_PLUGIN__H___ -#define ___NSIS_PLUGIN__H___ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "api.h" -#include "nsis_tchar.h" - -#ifndef NSISCALL -# define NSISCALL __stdcall -#endif - -#define EXDLL_INIT() { \ - g_stringsize=string_size; \ - g_stacktop=stacktop; \ - g_variables=variables; } - -typedef struct _stack_t { - struct _stack_t *next; - TCHAR text[1]; // this should be the length of string_size -} stack_t; - -enum -{ -INST_0, // $0 -INST_1, // $1 -INST_2, // $2 -INST_3, // $3 -INST_4, // $4 -INST_5, // $5 -INST_6, // $6 -INST_7, // $7 -INST_8, // $8 -INST_9, // $9 -INST_R0, // $R0 -INST_R1, // $R1 -INST_R2, // $R2 -INST_R3, // $R3 -INST_R4, // $R4 -INST_R5, // $R5 -INST_R6, // $R6 -INST_R7, // $R7 -INST_R8, // $R8 -INST_R9, // $R9 -INST_CMDLINE, // $CMDLINE -INST_INSTDIR, // $INSTDIR -INST_OUTDIR, // $OUTDIR -INST_EXEDIR, // $EXEDIR -INST_LANG, // $LANGUAGE -__INST_LAST -}; - - -static unsigned int g_stringsize; -static stack_t **g_stacktop; -static TCHAR *g_variables; - - -// utility functions (not required but often useful) -static int NSISCALL popstring(TCHAR *str) -{ - stack_t *th; - if (!g_stacktop || !*g_stacktop) return 1; - th=(*g_stacktop); - _tcscpy(str,th->text); - *g_stacktop = th->next; - GlobalFree((HGLOBAL)th); - return 0; -} - -static void NSISCALL pushstring(const TCHAR *str) -{ - stack_t *th; - if (!g_stacktop) return; - th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize); - _tcsncpy(th->text,str,g_stringsize); - th->next=*g_stacktop; - *g_stacktop=th; -} - -static TCHAR * NSISCALL getuservariable(const int varnum) -{ - if (varnum < 0 || varnum >= __INST_LAST) return NULL; - return g_variables+varnum*g_stringsize; -} - -static void NSISCALL setuservariable(const int varnum, const TCHAR *var) -{ - if (var != NULL && varnum >= 0 && varnum < __INST_LAST) - _tcscpy(g_variables + varnum*g_stringsize, var); -} - - -#ifdef __cplusplus -} -#endif - -#endif//!___NSIS_PLUGIN__H___ diff --git a/installer/md5dll/readme.txt b/installer/md5dll/readme.txt deleted file mode 100644 index a8d3572c7..000000000 --- a/installer/md5dll/readme.txt +++ /dev/null @@ -1,68 +0,0 @@ -Calculates the md5sum of a file or string. -Has been tested to work with NSIS 2.0+ - - -Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm - -[Md5Dll] -Matthew "IGx89" Lieder - -Original plugin Author - -Sunjammer (12th May 2002) - -Original usage notes and example script - -[Md5Dll.0.1] -KJD (2004) - -Modified to reduce size and use exdll.h - (reduced to about 6KB uncompressed, by removing CRTL dependency) - -[Md5dll.0.2] -Davy Durham (2004) - -MD5.cpp fix (correct for loop used to replace memset, exceeded bounds) - -[Md5dll.0.3] -Shengalts Aleksander aka Instructor (2005) - -New command: "GetMD5Random" - -Changed names: "GetFileMD5" -> "GetMD5File", "GetMD5" -> "GetMD5String" - -Fixed: string length error - -[Md5dll.0.4] -KJD (2005) - -Added dual name to exports for backwards compatibility - - --------------------------------- - -Usage: - -Push $1 ;string -CallInstDll "md5dll" GetMD5String -Pop $1 ;md5 of string - --or- - -Push $1 ;filename -CallInstDll "md5dll" GetMD5File -Pop $1 ;md5 of file - --------------------------------- - -Example usage in recent NSIS versions - -OutFile "md5test.exe" -Section "" - #generate MD5sum of a string - md5dll::GetMD5String "md5me" - Pop $0 - DetailPrint "md5: [$0]" - - # generate MD5sum of a file - md5dll::GetMD5File "${NSISDIR}\makensis.exe" - Pop $0 - DetailPrint "md5: [$0]" - - #generate random MD5sum - md5dll::GetMD5Random - Pop $0 - DetailPrint "md5: [$0]" -SectionEnd From 5d2586c9d7dda548ded4af5c3558b3cbccb5d035 Mon Sep 17 00:00:00 2001 From: "Hong Jen-Yee (PCMan)" Date: Sun, 18 Oct 2026 22:09:47 -0700 Subject: [PATCH 2/2] ci: download CMake from GitHub Releases in AppVeyor AppVeyor CI failed during environment setup because downloading CMake 4.3.0 from cmake.org timed out with 'Unable to connect to the remote server'. - Switch the download source for CMake 4.3.0 to the official Kitware GitHub Releases asset URL. - Fix a typo in the comment referencing VS 2026. Generated with assistance from Antigravity (Gemini 3.8 Flash). --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 79880b6e3..2a8d7503c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,9 +16,9 @@ install: - git submodule init - git submodule update - # The appveyor image contains cmake 4.1 only, which doesn't support VS 2016. + # The appveyor image contains cmake 4.1 only, which doesn't support VS 2026. # Download cmake 4.3.0 and add it to the PATH. - - appveyor DownloadFile https://cmake.org/files/v4.3/cmake-4.3.0-windows-x86_64.zip -FileName cmake43.zip + - appveyor DownloadFile https://github.com/Kitware/CMake/releases/download/v4.3.0/cmake-4.3.0-windows-x86_64.zip -FileName cmake43.zip - 7z x cmake43.zip -oC:\cmake43 - set "PATH=C:\cmake43\cmake-4.3.0-windows-x86_64\bin;%PATH%" - cmake --version # should print 4.3.0