File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ Run "PyInstaller build" { python -m PyInstaller --noconfirm --distpath dist pack
3131Run " MEDHA.exe --selftest" { & dist\MEDHA\MEDHA.exe -- selftest }
3232Copy-Item - Recurse dist\MEDHA " $layout \MEDHA"
3333(Get-Content packaging\windows\AppxManifest.xml - Raw).Replace(" __VERSION__" , $msixVer ) | Set-Content " $layout \AppxManifest.xml" - Encoding utf8
34+ # MSIX rejects some file names (makeappx error 0x8007007b). Drop NSIS/7z leftovers
35+ # whose names start with '$', then report any remaining name outside the safe set.
36+ Get-ChildItem $layout - Recurse - Force | Where-Object { $_.Name -like ' $*' } | Remove-Item - Recurse - Force - ErrorAction SilentlyContinue
37+ $bad = Get-ChildItem $layout - Recurse - Force | Where-Object { $_.Name -notmatch ' ^[A-Za-z0-9_.\- ()+~@,=\[\]]+$' -or $_.Name -match ' [. ]$' -or $_.Name -match ' ^(CON|PRN|AUX|NUL|COM\d|LPT\d)(\..*)?$' }
38+ if ($bad ) { Write-Host (" ::warning title=Unusual file names in package::" + (($bad | ForEach-Object { $_.FullName.Substring ($layout.Length ) }) -join " %0A" )) }
3439$makeappx = Get-ChildItem " ${env: ProgramFiles(x86)} \Windows Kits\10\bin\*\x64\makeappx.exe" | Sort-Object FullName - Descending | Select-Object - First 1
3540Run " makeappx pack" { & $makeappx.FullName pack / v / d $layout / p " dist\MEDHA-$ver .msix" / o }
3641Compress-Archive - Path dist\MEDHA - DestinationPath " dist\MEDHA-$ver -portable.zip" - Force
You can’t perform that action at this time.
0 commit comments