Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added desktop-package/DebugCertificate.pfx
Binary file not shown.
10 changes: 10 additions & 0 deletions desktop-package/_win-make-debug-cert.ps1
Original file line number Diff line number Diff line change
@@ -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
126 changes: 126 additions & 0 deletions desktop-package/_win-make-msix.ps1
Original file line number Diff line number Diff line change
@@ -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 '(<Identity[^>]*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
}
}
33 changes: 33 additions & 0 deletions desktop-package/_win-sign-msix-package.ps1
Original file line number Diff line number Diff line change
@@ -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
54 changes: 54 additions & 0 deletions desktop-package/windows-store-assets/AppxManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10">

<Identity
Name="HardcoreEngineering.Huly"
Publisher="CN=Hardcore Engineering Inc"
Version="0.6.0.0" />

<Properties>
<DisplayName>Huly</DisplayName>
<PublisherDisplayName>Hardcore Engineering Inc</PublisherDisplayName>
<Logo>windows_store_assets\StoreLogo.png</Logo>
<Description>Huly Desktop experience</Description>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.22621.0" />
</Dependencies>

<Resources>
<Resource Language="en-us" />
</Resources>

<Applications>
<Application
Id="Huly"
Executable="Huly.exe"
EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
DisplayName="Huly"
Description="Huly Desktop Experience"
BackgroundColor="transparent"
Square150x150Logo="windows_store_assets\Square150x150Logo.png"
Square44x44Logo="windows_store_assets\Square44x44Logo.png">
<uap:DefaultTile
Wide310x150Logo="windows_store_assets\Wide310x150Logo.png"
Square310x310Logo="windows_store_assets\Square310x310Logo.png"
Square71x71Logo="windows_store_assets\Square71x71Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="windows_store_assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>

</Package>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading