diff --git a/desktop-package/DebugCertificate.pfx b/desktop-package/DebugCertificate.pfx new file mode 100644 index 0000000000..dddd4e2680 Binary files /dev/null and b/desktop-package/DebugCertificate.pfx differ diff --git a/desktop-package/_win-make-debug-cert.ps1 b/desktop-package/_win-make-debug-cert.ps1 new file mode 100644 index 0000000000..cd2a96fcef --- /dev/null +++ b/desktop-package/_win-make-debug-cert.ps1 @@ -0,0 +1,10 @@ +$cert = New-SelfSignedCertificate -Type CodeSigningCert ` + -Subject "CN=Hardcore Engineering Inc" ` + -KeyAlgorithm RSA ` + -KeyLength 2048 ` + -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" ` + -CertStoreLocation "Cert:\CurrentUser\My" ` + -NotAfter (Get-Date).AddYears(5) + +$password = ConvertTo-SecureString -String "poiuytrewq0987654321POIUYTREWQ" -Force -AsPlainText +Export-PfxCertificate -Cert $cert -FilePath "DebugCertificate.pfx" -Password $password \ No newline at end of file diff --git a/desktop-package/_win-make-msix.ps1 b/desktop-package/_win-make-msix.ps1 new file mode 100644 index 0000000000..3cceb5fb94 --- /dev/null +++ b/desktop-package/_win-make-msix.ps1 @@ -0,0 +1,126 @@ +#Requires -Version 5.1 + +[CmdletBinding()] +param() + +$ErrorActionPreference = "Stop" + +Set-Location $PSScriptRoot + +$appxBuild = $null + +try { + Write-Host "Getting version from show_version.js..." + $versionOutput = & node "..\common\scripts\show_version.js" + if ($LASTEXITCODE -ne 0) { + throw "Failed to get version from show_version.js" + } + + $version = $versionOutput -replace '"', '' + + Write-Host "========================================" + Write-Host "Building MSIX package for Huly Desktop" + Write-Host "Version: $version" + Write-Host "========================================" + + if (!(Test-Path "deploy\win-unpacked")) { + Write-Error "ERROR: deploy\win-unpacked folder not found!" + Write-Host "Please build the Windows app first using: rushx dist-mac-win" + exit 1 + } + + $makeappxPath = Get-Command "makeappx.exe" -ErrorAction SilentlyContinue + if (!$makeappxPath) { + Write-Host "makeappx.exe not found in PATH, searching in Windows SDK..." + + $sdkBasePath = "C:\Program Files (x86)\Windows Kits\10\bin" + + if (Test-Path $sdkBasePath) { + # Найти последнюю версию SDK + $latestSDK = Get-ChildItem $sdkBasePath -Directory | + Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | + Sort-Object Name -Descending | + Select-Object -First 1 + + if ($latestSDK) { + $makeappxFullPath = Join-Path $latestSDK.FullName "x64\makeappx.exe" + + if (Test-Path $makeappxFullPath) { + Write-Host "Found makeappx.exe at: $makeappxFullPath" + $makeappxPath = Get-Command $makeappxFullPath + } + } + } + + if (!$makeappxPath) { + Write-Error "ERROR: makeappx.exe not found!" + Write-Host "Please install Windows 10 SDK from: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/" + exit 1 + } + } + + $appxBuild = "deploy\__appx-build" + if (Test-Path $appxBuild) { + Remove-Item $appxBuild -Recurse -Force + } + New-Item -ItemType Directory -Path $appxBuild -Force | Out-Null + + Write-Host "" + Write-Host "Step 1: Copying application files..." + Copy-Item "deploy\win-unpacked\*" -Destination $appxBuild -Recurse -Force + + Write-Host "Step 2: Copying manifest and assets..." + Copy-Item "windows-store-assets\AppxManifest.xml" -Destination "$appxBuild\AppxManifest.xml" -Force + + $assetsPath = "$appxBuild\Assets" + if (!(Test-Path $assetsPath)) { + New-Item -ItemType Directory -Path $assetsPath -Force | Out-Null + } + + $pngFiles = Get-ChildItem "windows-store-assets\*.png" -ErrorAction SilentlyContinue + if ($pngFiles) { + Copy-Item $pngFiles -Destination $assetsPath -Force + } + + Write-Host "Step 3: Updating manifest version..." + $manifestPath = "$appxBuild\AppxManifest.xml" + $manifestContent = Get-Content $manifestPath -Raw + $manifestContent = $manifestContent -replace '(]*Version=")[0-9.]+(")', "`${1}$version.0`${2}" + Set-Content -Path $manifestPath -Value $manifestContent -NoNewline + + Write-Host "Step 4: Fixing asset paths in manifest..." + $manifestContent = Get-Content $manifestPath -Raw + $manifestContent = $manifestContent -replace 'windows_store_assets\\', 'Assets\' + Set-Content -Path $manifestPath -Value $manifestContent -NoNewline + + Write-Host "Step 5: Creating MSIX package..." + $appxOutput = "deploy\Huly-windows-$version.msix" + if (Test-Path $appxOutput) { + Remove-Item $appxOutput -Force + } + + $makeappxArgs = @("pack", "/d", $appxBuild, "/p", $appxOutput, "/overwrite") + & $makeappxPath $makeappxArgs + + if ($LASTEXITCODE -ne 0) { + throw "Failed to create MSIX package!" + } + + Write-Host "" + Write-Host "========================================" + Write-Host "SUCCESS! MSIX package created:" + Write-Host $appxOutput + Write-Host "========================================" + Write-Host "" + Write-Host "Note: The package is unsigned. To sign it, run:" + Write-Host "signtool sign /fd SHA256 /a /f YourCertificate.pfx /p YourPassword `"$appxOutput`"" + Write-Host "" + +} catch { + Write-Error "Build failed: $_" + exit 1 +} finally { + if ($null -ne $appxBuild -and (Test-Path $appxBuild)) { + Remove-Item $appxBuild -Recurse -Force -ErrorAction SilentlyContinue + } +} diff --git a/desktop-package/_win-sign-msix-package.ps1 b/desktop-package/_win-sign-msix-package.ps1 new file mode 100644 index 0000000000..92645c0757 --- /dev/null +++ b/desktop-package/_win-sign-msix-package.ps1 @@ -0,0 +1,33 @@ +$signtoolPath = Get-Command "signtool.exe" -ErrorAction SilentlyContinue +if (!$signtoolPath) { + Write-Host "signtool.exe not found in PATH, searching in Windows SDK..." + + $sdkBasePath = "C:\Program Files (x86)\Windows Kits\10\bin" + + if (Test-Path $sdkBasePath) { + $latestSDK = Get-ChildItem $sdkBasePath -Directory | + Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | + Sort-Object Name -Descending | + Select-Object -First 1 + + if ($latestSDK) { + $signtoolFullPath = Join-Path $latestSDK.FullName "x64\signtool.exe" + + if (Test-Path $signtoolFullPath) { + Write-Host "Found signtool.exe at: $signtoolFullPath" + $signtoolPath = Get-Command $signtoolFullPath + } + } + } + + if (!$signtoolPath) { + Write-Error "ERROR: signtool.exe not found!" + Write-Host "Please install Windows 10 SDK from: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/" + exit 1 + } +} + +$msixFile = "deploy\Huly-windows-0.6.0.msix" + +& $signtoolPath sign /f DebugCertificate.pfx /p poiuytrewq0987654321POIUYTREWQ /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 $msixFile +& $signtoolPath verify /pa $msixFile diff --git a/desktop-package/windows-store-assets/AppxManifest.xml b/desktop-package/windows-store-assets/AppxManifest.xml new file mode 100644 index 0000000000..3a850a2368 --- /dev/null +++ b/desktop-package/windows-store-assets/AppxManifest.xml @@ -0,0 +1,54 @@ + + + + + + + Huly + Hardcore Engineering Inc + windows_store_assets\StoreLogo.png + Huly Desktop experience + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/desktop-package/windows-store-assets/SplashScreen.png b/desktop-package/windows-store-assets/SplashScreen.png new file mode 100644 index 0000000000..aa9687c75e Binary files /dev/null and b/desktop-package/windows-store-assets/SplashScreen.png differ diff --git a/desktop-package/windows-store-assets/Square150x150Logo.png b/desktop-package/windows-store-assets/Square150x150Logo.png new file mode 100644 index 0000000000..abb84bb9c3 Binary files /dev/null and b/desktop-package/windows-store-assets/Square150x150Logo.png differ diff --git a/desktop-package/windows-store-assets/Square310x310Logo.png b/desktop-package/windows-store-assets/Square310x310Logo.png new file mode 100644 index 0000000000..de68435ef8 Binary files /dev/null and b/desktop-package/windows-store-assets/Square310x310Logo.png differ diff --git a/desktop-package/windows-store-assets/Square44x44Logo.png b/desktop-package/windows-store-assets/Square44x44Logo.png new file mode 100644 index 0000000000..031b9ba7c5 Binary files /dev/null and b/desktop-package/windows-store-assets/Square44x44Logo.png differ diff --git a/desktop-package/windows-store-assets/Square71x71Logo.png b/desktop-package/windows-store-assets/Square71x71Logo.png new file mode 100644 index 0000000000..464389e3bc Binary files /dev/null and b/desktop-package/windows-store-assets/Square71x71Logo.png differ diff --git a/desktop-package/windows-store-assets/StoreLogo.png b/desktop-package/windows-store-assets/StoreLogo.png new file mode 100644 index 0000000000..cfc2c3382d Binary files /dev/null and b/desktop-package/windows-store-assets/StoreLogo.png differ diff --git a/desktop-package/windows-store-assets/Wide310x150Logo.png b/desktop-package/windows-store-assets/Wide310x150Logo.png new file mode 100644 index 0000000000..90a1434cc0 Binary files /dev/null and b/desktop-package/windows-store-assets/Wide310x150Logo.png differ