@@ -22,36 +22,30 @@ If (((Test-Path -Path $(Get-Content -Path .\filelist-pri.txt)) -Eq $false).Count
22
22
$null = $Host.UI.RawUI.ReadKey (' NoEcho,IncludeKeyDown' )
23
23
exit 1
24
24
} Else {
25
- $AppxManifestFile = " .\AppxManifest.xml "
25
+ New-Item - Path " ." - Name " priinfo " - ItemType " directory " | Out-Null
26
26
Copy-Item .\resources.pri - Destination " .\pri\resources.pri" | Out-Null
27
- $ProcNew = Start-Process - PassThru makepri.exe - NoNewWindow - Args " new /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o"
28
- $null = $ProcNew.Handle
29
- $ProcNew.WaitForExit ()
30
- If ($ProcNew.ExitCode -Ne 0 ) {
31
- Write-Warning " Failed to merge resources from pris`r`n Trying to dump pris to priinfo...."
32
- New-Item - Path " ." - Name " priinfo" - ItemType " directory"
33
- Clear-Host
34
- $PriItem = Get-Item " .\pri\*" - Include " *.pri"
35
- Write-Output " Dumping resources...."
36
- $i = 0
37
- $Processes = ForEach ($Item in $PriItem ) {
38
- Start-Process - PassThru - WindowStyle Hidden makepri.exe - Args " dump /if $ ( $Item | Resolve-Path - Relative) /o /es .\pri\resources.pri /of .\priinfo\$ ( $Item.Name ) .xml /dt detailed"
39
- ++ $i
40
- $Completed = ($i / $PriItem.count ) * 100
41
- Write-Progress - Activity " Dumping resources" - Status " Dumping $ ( $Item.Name ) :" - PercentComplete $Completed
42
- }
43
- $Processes | Wait-Process
44
- Write-Progress - Activity " Dumping resources" - Status " Ready" - Completed
45
- Clear-Host
46
- Write-Output " Creating pri from dumps...."
47
- $ProcNewFromDump = Start-Process - PassThru - NoNewWindow makepri.exe - Args " new /pr .\priinfo /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o"
48
- $null = $ProcNewFromDump.Handle
49
- $ProcNewFromDump.WaitForExit ()
50
- Remove-Item ' priinfo' - Recurse
51
- If ($ProcNewFromDump.ExitCode -Ne 0 ) {
52
- Write-Error " Failed to create resources from priinfos"
53
- exit 1
54
- }
27
+ Clear-Host
28
+ $AppxManifestFile = " .\AppxManifest.xml"
29
+ $PriItem = Get-Item " .\pri\*" - Include " *.pri"
30
+ Write-Output " Dumping resources...."
31
+ $i = 0
32
+ $Processes = ForEach ($Item in $PriItem ) {
33
+ Start-Process - PassThru - WindowStyle Hidden makepri.exe - Args " dump /if $ ( $Item | Resolve-Path - Relative) /o /es .\pri\resources.pri /of .\priinfo\$ ( $Item.Name ) .xml /dt detailed"
34
+ ++ $i
35
+ $Completed = ($i / $PriItem.count ) * 100
36
+ Write-Progress - Activity " Dumping resources" - Status " Dumping $ ( $Item.Name ) :" - PercentComplete $Completed
37
+ }
38
+ $Processes | Wait-Process
39
+ Write-Progress - Activity " Dumping resources" - Status " Ready" - Completed
40
+ Clear-Host
41
+ Write-Output " Creating pri from dumps...."
42
+ $ProcNewFromDump = Start-Process - PassThru - NoNewWindow makepri.exe - Args " new /pr .\priinfo /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o"
43
+ $null = $ProcNewFromDump.Handle
44
+ $ProcNewFromDump.WaitForExit ()
45
+ Remove-Item ' priinfo' - Recurse
46
+ If ($ProcNewFromDump.ExitCode -Ne 0 ) {
47
+ Write-Error " Failed to create resources from priinfos"
48
+ exit 1
55
49
}
56
50
57
51
$ProjectXml = [xml ](Get-Content $AppxManifestFile )
0 commit comments