1717using SharpCompress . Archives ;
1818using SharpCompress . Archives . SevenZip ;
1919using static Nuke . Common . Tools . DotNet . DotNetTasks ;
20+ using FileMode = System . IO . FileMode ;
2021using Project = Nuke . Common . ProjectModel . Project ;
2122
2223[ GitHubActions (
@@ -225,23 +226,23 @@ class Build : NukeBuild
225226 var rootDirectory = RootDirectory / "Publish" ;
226227 rootDirectory . DeleteDirectory ( ) ;
227228 DotNetPublish ( c => new DotNetPublishSettings ( )
228- . SetProject ( "KitopiaEx" )
229+ . SetProject ( RootDirectory / "KitopiaEx" / "KitopiaEx.csproj ")
229230 . SetOutput ( RootDirectory / "Publish" / "plugins" / "kitopiaex" )
230231 . SetRuntime ( "win-x64" )
231232 . SetFramework ( "net10.0" )
232233 . SetConfiguration ( "Release" )
233234 . SetSelfContained ( false )
234235 ) ;
235236 DotNetPublish ( c => new DotNetPublishSettings ( )
236- . SetProject ( "OnnxRuntime.CPU" )
237+ . SetProject ( RootDirectory / "OnnxRuntime.CPU" / "OnnxRuntime.CPU.csproj ")
237238 . SetOutput ( RootDirectory / "Publish" / "plugins" / "kitopiaonnxruntimecpu" )
238239 . SetRuntime ( "win-x64" )
239240 . SetFramework ( "net10.0" )
240241 . SetConfiguration ( "Release" )
241242 . SetSelfContained ( false )
242243 ) ;
243244 DotNetPublish ( c => new DotNetPublishSettings ( )
244- . SetProject ( AvaloniaProject . Name )
245+ . SetProject ( AvaloniaProject . Path )
245246 . SetOutput ( RootDirectory / "Publish" )
246247 . SetRuntime ( "win-x64" )
247248 . SetFramework ( "net10.0-windows10.0.19041.0" )
@@ -338,71 +339,31 @@ class Build : NukeBuild
338339 . OnlyWhenDynamic ( ( ) => ! IsRelease || release != null )
339340 . Executes ( ( ) =>
340341 {
341- Directory . CreateDirectory ( RootDirectory / "ModernInstaller " / "Assets " ) ;
342+ Directory . CreateDirectory ( RootDirectory / "ModernInstallerR " / "installer_assets " ) ;
342343 var directoryInfo = new DirectoryInfo ( RootDirectory / "build" / "InstallerAssets" ) ;
343344 foreach ( var enumerateFile in directoryInfo . EnumerateFiles ( ) )
344345 {
345- File . Copy ( enumerateFile . FullName , RootDirectory / "ModernInstaller " / "Assets " / enumerateFile . Name ,
346+ File . Copy ( enumerateFile . FullName , RootDirectory / "ModernInstallerR " / "installer_assets " / enumerateFile . Name ,
346347 true ) ;
347348 }
348-
349- File . Copy ( RootDirectory / "Kitopia" + AvaloniaProject . GetProperty ( "Version" ) +
350- "_WithoutContained.zip" , RootDirectory / "ModernInstaller" / "Assets" / "App.zip" , true ) ;
351- } ) ;
352-
353- Target PrepareNative => _ => _
354- . DependsOn ( PreparePackInstallerGithub )
355- . OnlyWhenDynamic ( ( ) => ! IsRelease || release != null )
356- . Executes ( ( ) =>
357- {
358- if ( ! File . Exists ( RootDirectory / "ModernInstaller" / "Natives" / "Windows-x86" / "libHarfBuzzSharp.lib" ) )
359- {
360- using var sevenZipArchive = SevenZipArchive . Open ( RootDirectory / "ModernInstaller" / "Natives" /
361- "Windows-x86" / "Windows-x86.7z" ) ;
362- sevenZipArchive . ExtractToDirectory ( RootDirectory / "ModernInstaller" / "Natives" / "Windows-x86" ) ;
363- }
364- } ) ;
365-
366- Target BuildNativeUninstaller => _ => _
367- . DependsOn ( PrepareNative )
368- . OnlyWhenDynamic ( ( ) => ! IsRelease || release != null )
369- . Executes ( ( ) =>
370- {
371- DotNetPublish ( c => new DotNetPublishSettings ( )
372- . SetProject ( $ "ModernInstaller{ Path . DirectorySeparatorChar } ModernInstaller.Uninstaller")
373- . SetOutput ( RootDirectory / "ModernInstaller" / "Publish" )
374- . SetFramework ( "net10.0-windows" )
375- . SetRuntime ( "win-x86" )
376- . SetConfiguration ( "Release" )
377- . SetSelfContained ( true )
378- ) ;
379- } ) ;
380-
381- Target PrepareBuildNativeInstaller => _ => _
382- . DependsOn ( BuildNativeUninstaller )
383- . OnlyWhenDynamic ( ( ) => ! IsRelease || release != null )
384- . Executes ( ( ) =>
385- {
386- File . Copy ( RootDirectory / "ModernInstaller" / "Publish" / "ModernInstaller.Uninstaller.exe" ,
387- RootDirectory / "Assets" / "ModernInstaller.Uninstaller.exe" , true ) ;
388- PowerShellTasks . PowerShell (
389- $ "ModernInstaller{ Path . DirectorySeparatorChar } build{ Path . DirectorySeparatorChar } upx.exe --force --lzma { RootDirectory / "ModernInstaller" / "Publish" / "ModernInstaller.Uninstaller.exe" } ") ;
349+ var rootDirectory = RootDirectory / "Publish" ;
350+ var pluginDirectory = rootDirectory / "plugins" ;
351+
352+ var destPluginZip = RootDirectory / "ModernInstallerR" / "installer_assets" / "plugins.zip" ;
353+ pluginDirectory . ZipTo ( destPluginZip , compressionLevel : CompressionLevel . SmallestSize , fileMode : FileMode . Create ) ;
354+ pluginDirectory . DeleteDirectory ( ) ;
355+
356+ var destAppZip = RootDirectory / "ModernInstallerR" / "installer_assets" / "App.zip" ;
357+ rootDirectory . ZipTo ( destAppZip , compressionLevel : CompressionLevel . SmallestSize , fileMode : FileMode . Create ) ;
358+
359+
390360 } ) ;
391-
392361 Target BuildNativeInstaller => _ => _
393- . DependsOn ( PrepareBuildNativeInstaller )
362+ . DependsOn ( PreparePackInstallerGithub )
394363 . OnlyWhenDynamic ( ( ) => ! IsRelease || release != null )
395364 . Executes ( ( ) =>
396365 {
397- DotNetPublish ( c => new DotNetPublishSettings ( )
398- . SetProject ( $ "ModernInstaller{ Path . DirectorySeparatorChar } ModernInstaller")
399- . SetOutput ( RootDirectory / "ModernInstaller" / "Publish" )
400- . SetFramework ( "net10.0-windows" )
401- . SetRuntime ( "win-x86" )
402- . SetConfiguration ( "Release" )
403- . SetSelfContained ( true )
404- . SetPublishSingleFile ( true )
405- ) ;
366+ PowerShellTasks . PowerShell ( "scripts/build_release.ps1" , workingDirectory : RootDirectory / "ModernInstallerR" ) ;
406367 } ) ;
407368
408369 Target PackInstaller => _ => _
@@ -412,9 +373,8 @@ class Build : NukeBuild
412373 . OnlyWhenDynamic ( ( ) => ! IsRelease || release != null )
413374 . Executes ( ( ( ) =>
414375 {
415- var moderninstallerExe = RootDirectory / "ModernInstaller" / "Publish" / "ModernInstaller.exe" ;
416- PowerShellTasks . PowerShell (
417- $ "ModernInstaller{ Path . DirectorySeparatorChar } build{ Path . DirectorySeparatorChar } upx.exe --force --lzma { moderninstallerExe } ") ;
376+ var moderninstallerExe = RootDirectory / "ModernInstallerR" / "dist" /
377+ "x86_64-pc-windows-msvc" / "ModernInstaller.exe" ;
418378
419379 Log . Debug ( "Installer created: {0}" , moderninstallerExe ) ;
420380
0 commit comments