Skip to content

Commit

Permalink
update KNI SDK (#2177)
Browse files Browse the repository at this point in the history
* remove Kni.Content.Builder.targets

* update nsis

* do not install tools in MSBuild

* remove old templates

* install packages locally

* do not install Assemblies

* update License

* disable packages
  • Loading branch information
nkast authored Jan 8, 2025
1 parent 47be096 commit af210fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 319 deletions.
134 changes: 10 additions & 124 deletions Installers/Windows/KniSdkSetup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SetCompressor /SOLID /FINAL lzma

!include "header.nsh"
!include "LogicLib.nsh"
!define APPNAME "MonoGame"
!define APPNAME "KNI"

;Include Modern UI

Expand Down Expand Up @@ -45,7 +45,6 @@ Page Custom SponsorPage SponsorPageLeave
Name '${APPNAME} SDK ${INSTALLERVERSION}'
OutFile 'KniSdkSetup.exe'
InstallDir '$PROGRAMFILES\${APPNAME}\v${VERSION}'
!define MSBuildInstallDir '$PROGRAMFILES32\MSBuild\${APPNAME}\v${VERSION}'
VIProductVersion "${INSTALLERVERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPNAME} SDK"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Kni framework"
Expand Down Expand Up @@ -76,12 +75,8 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright © Kni framewo
Section "Kni Core Components" CoreComponents ;No components page, name is not important
SectionIn RO

; Install the VS support files.
SetOutPath ${MSBuildInstallDir}
File '..\..\Tools\Build.Targets\Kni.Content.Builder.targets'

; Install the Kni tools to a single shared folder.
SetOutPath ${MSBuildInstallDir}\Tools
SetOutPath '$INSTDIR\Tools'
File /r '..\..\Tools\EffectCompiler\bin\Windows\AnyCPU\Release\net8.0\*.exe'
File /r '..\..\Tools\EffectCompiler\bin\Windows\AnyCPU\Release\net8.0\*.runtimeconfig.json'
File /r '..\..\Tools\EffectCompiler\bin\Windows\AnyCPU\Release\net8.0\*.dll'
Expand All @@ -96,95 +91,13 @@ Section "Kni Core Components" CoreComponents ;No components page, name is not im
File '..\..\Artifacts\Xna.Framework.Design\Release\netstandard2.0\*.dll'

; Associate .mgcb files open in the Pipeline tool.
!insertmacro VS_ASSOCIATE_EDITOR 'MonoGame Pipeline' '15.0' 'mgcb' '${MSBuildInstallDir}\Tools\PipelineEditor.exe'
!insertmacro APP_ASSOCIATE 'mgcb' 'MonoGame.ContentBuilderFile' 'A MonoGame content builder project.' '${MSBuildInstallDir}\Tools\PipelineEditor.exe,0' 'Open with PipelineEditor' '${MSBuildInstallDir}\Tools\PipelineEditor.exe "%1"'

; Install the assemblies for all the platforms we can
; target from a Windows desktop system.

; Install framework Assemblies
SetOutPath '$INSTDIR\Assemblies\Framework\net40'
File '..\..\Artifacts\Xna.Framework\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Design\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Content\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Graphics\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Audio\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Media\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Input\Release\net40\*.*'
File '..\..\Artifacts\Xna.Framework.Game\Release\net40\*.*'
SetOutPath '$INSTDIR\Assemblies\Framework\netstandard2.0'
File '..\..\Artifacts\Xna.Framework\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Design\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Content\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Graphics\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Audio\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Media\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Input\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Game\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Devices\Release\netstandard2.0\*.*'
File '..\..\Artifacts\Xna.Framework.Storage\Release\netstandard2.0\*.*'

; Install Reference Assemblies
SetOutPath '$INSTDIR\Assemblies\Ref\net40'
File '..\..\Artifacts\Platforms\Ref\Release\net40\*.*'
SetOutPath '$INSTDIR\Assemblies\Ref\netstandard2.0'
File '..\..\Artifacts\Platforms\Ref\Release\netstandard2.0\*.*'

; Install Android Assemblies
SetOutPath '$INSTDIR\Assemblies\Android'
File '..\..\Platforms\bin\Android\AnyCPU\Release\*.dll'
File '..\..\Platforms\bin\Android\AnyCPU\Release\*.xml'

; Install DesktopGL Assemblies
SetOutPath '$INSTDIR\Assemblies\DesktopGL'
File /nonfatal '..\..\Artifacts\Platforms\DesktopGL\Release\net40\*.dll'
File /nonfatal '..\..\Artifacts\Platforms\DesktopGL\Release\net40\*.xml'
File '..\..\ThirdParty\Dependencies\SDL\MacOS\Universal\libSDL2.dylib'
File '..\..\ThirdParty\Dependencies\openal-soft\MacOS\Universal\libopenal.1.dylib'
File '..\..\ThirdParty\Dependencies\MonoGame.Framework.dll.config'

; Install x86 DesktopGL Dependencies
SetOutPath '$INSTDIR\Assemblies\DesktopGL\x86'
File '..\..\ThirdParty\Dependencies\SDL\Windows\x86\SDL2.dll'
File '..\..\ThirdParty\Dependencies\openal-soft\Windows\x86\soft_oal.dll'
File '..\..\ThirdParty\Dependencies\openal-soft\Linux\x86\libopenal.so.1'

; Install x64 DesktopGL Dependencies
SetOutPath '$INSTDIR\Assemblies\DesktopGL\x64'
File '..\..\ThirdParty\Dependencies\SDL\Windows\x64\SDL2.dll'
File '..\..\ThirdParty\Dependencies\openal-soft\Windows\x64\soft_oal.dll'
File '..\..\ThirdParty\Dependencies\SDL\Linux\x64\libSDL2-2.0.so.0'
File '..\..\ThirdParty\Dependencies\openal-soft\Linux\x64\libopenal.so.1'

; Install Windows Desktop DirectX Assemblies
SetOutPath '$INSTDIR\Assemblies\Windows'
File '..\..\Artifacts\Platforms\WindowsDX\Release\net40\*.dll'
File '..\..\Artifacts\Platforms\WindowsDX\Release\net40\*.xml'

; Install Windows 10 UAP Assemblies
SetOutPath '$INSTDIR\Assemblies\WindowsUniversal'
;File '..\..\Platforms\bin\WindowsUniversal\Release\uap10.0\*.dll'
;File '..\..\Platforms\bin\WindowsUniversal\Release\uap10.0\*.xml'
File '..\..\Platforms\bin\WindowsUniversal\AnyCPU\Release\*.dll'
File '..\..\Platforms\bin\WindowsUniversal\AnyCPU\Release\*.xml'

; Install iOS Assemblies
IfFileExists `$PROGRAMFILES\MSBuild\Xamarin\iOS\*.*` InstalliOSAssemblies SkipiOSAssemblies
InstalliOSAssemblies:
;SetOutPath '$INSTDIR\Assemblies\iOS'
;File '..\..\Artifacts\Platforms\iOS\Release\xamarinios10\*.dll'
;File '..\..\Artifacts\Platforms\iOS\Release\xamarinios10\*.xml'
SkipiOSAssemblies:

WriteRegStr HKLM 'SOFTWARE\Microsoft\MonoAndroid\v2.3\AssemblyFoldersEx\${APPNAME} for Android' '' '$INSTDIR\Assemblies\Android'
WriteRegStr HKLM 'SOFTWARE\Microsoft\MonoTouch\v1.0\AssemblyFoldersEx\${APPNAME} for iOS' '' '$INSTDIR\Assemblies\iOS'

IfFileExists $WINDIR\SYSWOW64\*.* Is64bit Is32bit
Is32bit:
GOTO End32Bitvs64BitCheck
Is64bit:
WriteRegStr HKLM 'SOFTWARE\Wow6432Node\Microsoft\MonoTouch\v1.0\AssemblyFoldersEx\${APPNAME} for iOS' '' '$INSTDIR\Assemblies\iOS'
!insertmacro VS_ASSOCIATE_EDITOR 'MonoGame Pipeline' '15.0' 'mgcb' '$INSTDIR\Tools\PipelineEditor.exe'
!insertmacro APP_ASSOCIATE 'mgcb' 'MonoGame.ContentBuilderFile' 'A MonoGame content builder project.' '$INSTDIR\Tools\PipelineEditor.exe,0' 'Open with PipelineEditor' '$INSTDIR\Tools\PipelineEditor.exe "%1"'

; Install framework packages
;SetOutPath '$INSTDIR\Packages\'
;File '..\..\Artifacts\Packages\*.*'

End32Bitvs64BitCheck:
; Add remote programs
WriteRegStr HKLM 'Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}' 'DisplayName' '${APPNAME} SDK'
Expand Down Expand Up @@ -232,8 +145,8 @@ Section "Start Menu Shortcuts" Menu
CreateDirectory $SMPROGRAMS\${APPNAME}
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall MonoGame.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
SetOutPath "${MSBuildInstallDir}\Tools"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Kni PipelineEditor.lnk" "${MSBuildInstallDir}\Tools\PipelineEditor.exe" "" "${MSBuildInstallDir}\Tools\PipelineEditor.exe" 0
SetOutPath "$INSTDIR\Tools"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Kni PipelineEditor.lnk" "$INSTDIR\Tools\PipelineEditor.exe" "" "$INSTDIR\Tools\PipelineEditor.exe" 0
WriteINIStr "$SMPROGRAMS\${APPNAME}\MonoGame Website.url" "InternetShortcut" "URL" "http://www.monogame.net"
WriteINIStr "$SMPROGRAMS\${APPNAME}\MonoGame Website.url" "InternetShortcut" "IconFile" "$INSTDIR\Kni.ico"
WriteINIStr "$SMPROGRAMS\${APPNAME}\MonoGame Website.url" "InternetShortcut" "IconIndex" "0"
Expand Down Expand Up @@ -302,41 +215,14 @@ FunctionEnd
Section "Uninstall"

DeleteRegKey HKLM 'Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}'
DeleteRegKey HKLM 'SOFTWARE\Microsoft\MonoAndroid\v2.3\AssemblyFoldersEx\${APPNAME} for Android'
DeleteRegKey HKLM 'SOFTWARE\Microsoft\MonoTouch\v1.0\AssemblyFoldersEx\${APPNAME} for iOS'

;DeleteRegKey HKCU 'Software\Microsoft\VisualStudio\12.0\Default Editors\mgcb'

DeleteRegKey HKCR '.mgcb'
DeleteRegKey HKCR 'MonoGame.ContentBuilderFile'

IfFileExists $WINDIR\SYSWOW64\*.* Is64bit Is32bit
Is32bit:
GOTO End32Bitvs64BitCheck
Is64bit:
DeleteRegKey HKLM 'SOFTWARE\Wow6432Node\Microsoft\MonoAndroid\v2.3\AssemblyFoldersEx\${APPNAME} for Android'
DeleteRegKey HKLM 'SOFTWARE\Wow6432Node\Microsoft\MonoTouch\v1.0\AssemblyFoldersEx\${APPNAME} for iOS'


End32Bitvs64BitCheck:

ReadRegStr $0 HKLM 'SOFTWARE\Wow6432Node\Xamarin\MonoDevelop' "Path"
${If} $0 == "" ; check on 32 bit machines just in case
ReadRegStr $0 HKLM 'SOFTWARE\Xamarin\MonoDevelop' "Path"
${EndIf}

${If} $0 == ""
${Else}
RMDir /r "$0\AddIns\MonoDevelop.MonoGame"
${EndIf}

RMDir /r "$DOCUMENTS\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\KNI"
RMDir /r "$DOCUMENTS\Visual Studio 2013\Templates\ProjectTemplates\Visual C#\KNI"
RMDir /r "$DOCUMENTS\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\KNI"
RMDir /r "$DOCUMENTS\Visual Studio 2019\Templates\ProjectTemplates\Visual C#\KNI"
RMDir /r "$DOCUMENTS\Visual Studio 2022\Templates\ProjectTemplates\Visual C#\KNI"
RMDir /r "$DOCUMENTS\Visual Studio 2022\Templates\ItemTemplates\Visual C#\KNI"
RMDir /r "${MSBuildInstallDir}"
RMDir /r "$SMPROGRAMS\${APPNAME}"

Delete "$INSTDIR\Uninstall.exe"
Expand Down
2 changes: 1 addition & 1 deletion Installers/default.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<if test="${file::exists('C:\Program Files (x86)\NSIS\makensis.exe')}">
<echo append="false" file="Windows/header.nsh">
!define FrameworkPath "${project::get-base-directory()}"
!define VERSION "3.0"
!define VERSION "3.14"
!define INSTALLERVERSION "${buildNumber}"
</echo>
<exec program="makensis" workingdir="Windows" basedir="C:\Program Files (x86)\NSIS">
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Microsoft Public License (Ms-PL)
Kni - Copyright © 2014-2023 Nick Kastellanos
Kni - Copyright © 2014-2025 Nick Kastellanos

-------------------------------------------------------------------------------

Expand Down
193 changes: 0 additions & 193 deletions Tools/Build.Targets/Kni.Content.Builder.targets

This file was deleted.

0 comments on commit af210fb

Please sign in to comment.