From b153850d5c2e41cd171d8140c667132e505d7f14 Mon Sep 17 00:00:00 2001 From: locphamtran Date: Wed, 2 Sep 2026 12:46:24 +0700 Subject: [PATCH] V45.39: fix installer khong cai VC++ redist -> VST FX 0x7E tren may sach Root cause: bridges (/MD) import MSVCP140.dll/VCRUNTIME140*.dll nhung installer KHONG bao gio cai VC++ redist. hooks.nsh dinh nghia macro 'customInstall' - ten Tauri v2 khong goi (template dung NSIS_HOOK_POSTINSTALL) -> macro chet, vc_redist.x64.exe khong duoc nhung, khong chay. May phat trien chay duoc vi co MSVC BuildTools (redist san); may user sach: bridge khong start duoc -> moi VST/VST3 FX khong load (GUI khong mo), plugin /MD khac (iZotope core...) bao 0x7E. Fix: - hooks.nsh: doi macro thanh NSIS_HOOK_POSTINSTALL; vc_redist dong goi nhu bundle resource -> (File tuong doi trong macro resolve theo thu muc installer.nsi sinh ra, khong phai src-tauri - cung vay). ExecWait /install /quiet /norestart; xoa file sau khi cai xong (rc 0/3010). - tauri.conf.json: resources + vc_redist.x64.exe; nsis installMode perMachine (vc_redist can elevation; DAW scan Program Files plugin dirs). Verified: 7z l installer -> vc_redist.x64.exe embedded; installer.nsi insert NSIS_HOOK_POSTINSTALL; INSTALLMODE perMachine; makensis OK. NSIS +387MB. MSI (WiX) van khong cai redist - can cai tay tren may dung MSI. --- src-tauri/hooks.nsh | 11 ++++++++--- src-tauri/tauri.conf.json | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src-tauri/hooks.nsh b/src-tauri/hooks.nsh index ccec66d..a745d62 100644 --- a/src-tauri/hooks.nsh +++ b/src-tauri/hooks.nsh @@ -1,7 +1,12 @@ ; NSIS installer hooks — cai Microsoft Visual C++ Redistributable neu thieu ; (MSVCP140.dll missing). Dat vc_redist.x64.exe CANH tauri.conf.json ; (build_windows.ps1 tu tai ve neu chua co). -!macro customInstall - File "/oname=$PLUGINSDIR\vc_redist.x64.exe" "vc_redist.x64.exe" - ExecWait '"$PLUGINSDIR\vc_redist.x64.exe" /install /quiet /norestart' +!macro NSIS_HOOK_POSTINSTALL + ; vc_redist.x64.exe dong goi nhu bundle resource -> $INSTDIR (khong dung File: + ; path tuong doi trong macro resolve theo thu muc installer.nsi sinh ra). + ExecWait '"$INSTDIR\vc_redist.x64.exe" /install /quiet /norestart' $0 + ${If} $0 = 0 + ${OrIf} $0 = 3010 + Delete "$INSTDIR\vc_redist.x64.exe" + ${EndIf} !macroend diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 842bd04..bf36b90 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -25,12 +25,14 @@ "resources": { "resources/daw_engine": "daw_engine/", "binaries/libfluidsynth-3.dll": "libfluidsynth-3.dll", - "binaries/jpeg62.dll": "jpeg62.dll" + "binaries/jpeg62.dll": "jpeg62.dll", + "vc_redist.x64.exe": "vc_redist.x64.exe" }, "externalBin": ["binaries/daw_vst_bridge", "binaries/fx_vst_bridge", "binaries/plugin_host"], "windows": { "nsis": { - "installerHooks": "hooks.nsh" + "installerHooks": "hooks.nsh", + "installMode": "perMachine" } } }