Skip to content

installer: replace InstallOrSkip and md5dll with clean uninstall and direct File extraction - #968

Merged
PCMan merged 2 commits into
feature-nsis-arm64xfrom
refactor/installer-safe-delete
Oct 19, 2026
Merged

PCMan merged 2 commits into
feature-nsis-arm64xfrom
refactor/installer-safe-delete

Conversation

@PCMan

@PCMan PCMan commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

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 <temp>.deleted if in-use), allowing standard native NSIS File commands to write candidates directly with zero write errors.

Summary of Changes

  • SafeDeleteFile: Restores RebootFlag when rename succeeds, so temporary file cleanup scheduled on reboot does not trigger false reboot prompts or installation failures. Only true hard-locks (rename failure) set RebootFlag true.
  • CleanOldBinaries: Centralizes safe removal/renaming of all PIME DLLs and PIMELauncher.exe in $INSTDIR across x86, x64, and ARM64.
  • Installer Workflow:
    • Safely cleans/renames old binaries in uninstallOldVersion, SecMain, and Section "Uninstall".
    • Replaces InstallOrSkip with standard NSIS File commands in SecMain and the text service registration sections.
    • Removes .onInit extraction of candidate binaries to $PLUGINSDIR and the CopyFiles mechanism.
  • Dependency Removal: Completely removes the obsolete md5dll plugin directory (installer/md5dll) and its plugin directory registration.

Verification

  • Built installer/installer.nsi using NSIS 3.12 (makensis.exe) into PIME-2.0.0-beta3-setup.exe (44.0 MB, whole LZMA solid compression, exit code 0).

Note

This branch builds upon #965 (feature-nsis-arm64x).

Generated with assistance from Antigravity (Gemini 3.8 Flash).

…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 <temp>.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).
@PCMan
PCMan force-pushed the feature-nsis-arm64x branch from 6d42ff1 to c72678e Compare October 19, 2026 04:59
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).
@PCMan
PCMan merged commit c56a74d into feature-nsis-arm64x Oct 19, 2026
6 checks passed
@PCMan PCMan self-assigned this Oct 19, 2026
@PCMan
PCMan deleted the refactor/installer-safe-delete branch October 19, 2026 07:20
@PCMan
PCMan restored the refactor/installer-safe-delete branch October 19, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant