From 6b631c3fe822efa9bf4bc99329c16d7f5bed72f7 Mon Sep 17 00:00:00 2001 From: erik Date: Sun, 22 Jun 2025 13:21:34 +0200 Subject: [PATCH] test6 --- MosswartMassacre/scripts/installer.nsi | 46 +++++++++++++++++++------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/MosswartMassacre/scripts/installer.nsi b/MosswartMassacre/scripts/installer.nsi index 47289aa..2982fa0 100644 --- a/MosswartMassacre/scripts/installer.nsi +++ b/MosswartMassacre/scripts/installer.nsi @@ -1,14 +1,17 @@ ; Define your application name -!define APPNAME "MosswartMassacreNG" -!define SOFTWARECOMPANY "MosswartMassacreNG" -!define APPGUID "{4b1f02bb-9b95-46f0-ad5b-223fea7392fb}" -!define CLASSNAME "MosswartMassacreNG.PluginCore" -!define ASSEMBLY "MosswartMassacreNG.dll" +!define APPNAME "MosswartMassacre" +!define SOFTWARECOMPANY "MosswartMassacre" +!define APPGUID "{8C97E839-4D05-4A5F-B0C8-E8E778654322}" +!define CLASSNAME "MosswartMassacre.PluginCore" +!define ASSEMBLY "MosswartMassacre.dll" +!define LOADERGUID "{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}" +!define LOADERCLASS "MosswartMassacre.Loader.LoaderCore" +!define LOADERASSEMBLY "MosswartMassacre.Loader.dll" InstallDir "C:\Games\DecalPlugins\${APPNAME}" ;Icon "Installer\Res\Decal.ico" -!define BUILDPATH ".\..\..\bin\net48" +!define BUILDPATH ".\..\bin\Release" !getdllversion "${BUILDPATH}\${ASSEMBLY}" Expv_ !define VERSION ${Expv_1}.${Expv_2}.${Expv_3} @@ -145,7 +148,9 @@ Section "" CoreSection File "${BUILDPATH}\${ASSEMBLY}" File "${BUILDPATH}\${APPNAME}.pdb" - File "${BUILDPATH}\UtilityBelt.Service.Installer.exe" + File "${BUILDPATH}\${LOADERASSEMBLY}" + File "${BUILDPATH}\${APPNAME}.Loader.pdb" + ; File "${BUILDPATH}\UtilityBelt.Service.Installer.exe" SectionEnd @@ -171,16 +176,29 @@ Section -FinishSection ${ENDIF} ${EndIf} + ;Register loader in decal as network filter + ClearErrors + ReadRegStr $0 HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "" + ${If} ${Errors} + WriteRegStr HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "" "${APPNAME}.Loader" + WriteRegDWORD HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "Enabled" "0" ; Disabled by default for normal use + WriteRegStr HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "Object" "${LOADERCLASS}" + WriteRegStr HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "Assembly" "${LOADERASSEMBLY}" + WriteRegStr HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "Path" "$INSTDIR" + WriteRegStr HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "Surrogate" "{71A69713-6593-47EC-0002-0000000DECA1}" + WriteRegStr HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" "Uninstaller" "${APPNAME}" + ${Else} + ${IF} $0 != "${APPNAME}.Loader" + MESSAGEBOX MB_OK|MB_ICONSTOP "Skipped decal loader registration. A decal network filter with this GUID already exists ($0), and is not ${APPNAME}.Loader." + ${ENDIF} + ${EndIf} + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe" WriteUninstaller "$INSTDIR\uninstall.exe" ; make sure dotnet 4.8 is installed Call CheckAndDownloadDotNet48 - - ; make sure UtilityBelt.Service is installed - ; TODO: try and pull UtilityBelt.Service version from the registry and check it against the version required for this plugin - ExecWait '"$instdir\UtilityBelt.Service.Installer.exe"' SectionEnd @@ -195,6 +213,7 @@ Section Uninstall ;Remove from registry... DeleteRegKey HKLM "Software\${SOFTWARECOMPANY}\${APPNAME}" DeleteRegKey HKLM "Software\Decal\Plugins\${APPGUID}" + DeleteRegKey HKLM "Software\Decal\NetworkFilters\${LOADERGUID}" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" ; Delete self @@ -203,7 +222,10 @@ Section Uninstall ;Clean up Delete "$INSTDIR\${ASSEMBLY}" Delete "$INSTDIR\${APPNAME}.pdb" - Delete "$INSTDIR\UtilityBelt.Service.Installer.exe" + Delete "$INSTDIR\${LOADERASSEMBLY}" + Delete "$INSTDIR\${APPNAME}.Loader.pdb" + Delete "$INSTDIR\loader_log.txt" + ; Delete "$INSTDIR\UtilityBelt.Service.Installer.exe" ;RMDir "$INSTDIR\"