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" } } }