Skip to content

Commit

Permalink
Fix setMSG
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Jan 25, 2025
1 parent 21df8df commit 803070f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
9 changes: 6 additions & 3 deletions android/setup.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
function setMSGTemp($message){
$progressBarValue = Get-Content -Path "$env:APPDATA\EmuDeck\logs\msg.log" -TotalCount 1 -ErrorAction SilentlyContinue
$progressBarUpdate=[int]$progressBarValue+1

if ($progressBarValue -match '^\d+$') {
$progressBarUpdate = [int]$progressBarValue + 5
} else {
$progressBarUpdate = 5
}
#We prevent the UI to close if we have too much MSG, the classic eternal 99%
if ( $progressBarUpdate -eq 95 ){
$progressBarUpdate=90
}
"$progressBarUpdate" | Out-File -encoding ascii "$env:APPDATA\EmuDeck\logs\msg.log"
Write-Output $message
Add-Content "$env:APPDATA\EmuDeck\logs\msg.log" "# $message" -NoNewline -Encoding UTF8
Add-Content "$env:APPDATA\EmuDeck\logs\msg.log" "$progressBarUpdate# $message" -NoNewline -Encoding UTF8
Start-Sleep -Seconds 0.5
}
setMSGTemp 'Creating configuration files. please wait'
Expand Down
4 changes: 3 additions & 1 deletion functions/helperFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ function setMSG($message){
$progressBarValue = Get-Content -Path "$emudeckFolder\logs\msg.log" -TotalCount 1 -ErrorAction SilentlyContinue
if ($progressBarValue -match '^\d+$') {
$progressBarUpdate = [int]$progressBarValue + 5
} else {
$progressBarUpdate = 5
}
#We prevent the UI to close if we have too much MSG, the classic eternal 99%
if ( $progressBarUpdate -eq 95 ){
$progressBarUpdate=90
}
"$progressBarUpdate" | Out-File -encoding ascii "$emudeckFolder\logs\msg.log"
Write-Output $message
Add-Content "$emudeckFolder\logs\msg.log" "# $message" -NoNewline -Encoding UTF8
Add-Content "$emudeckFolder\logs\msg.log" "$progressBarUpdate# $message" -NoNewline -Encoding UTF8
Start-Sleep -Seconds 0.5
}

Expand Down
11 changes: 7 additions & 4 deletions setup.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
function setMSGTemp($message){
$progressBarValue = Get-Content -Path "$env:APPDATA\EmuDeck\msg.log" -TotalCount 1 -ErrorAction SilentlyContinue
$progressBarUpdate=[int]$progressBarValue+1

$progressBarValue = Get-Content -Path "$env:APPDATA\EmuDeck\logs\msg.log" -TotalCount 1 -ErrorAction SilentlyContinue
if ($progressBarValue -match '^\d+$') {
$progressBarUpdate = [int]$progressBarValue + 5
} else {
$progressBarUpdate = 5
}
#We prevent the UI to close if we have too much MSG, the classic eternal 99%
if ( $progressBarUpdate -eq 95 ){
$progressBarUpdate=90
}
"$progressBarUpdate" | Out-File -encoding ascii "$env:APPDATA\EmuDeck\logs\msg.log"
Write-Output $message
Add-Content "$env:APPDATA\EmuDeck\logs\msg.log" "# $message" -NoNewline -Encoding UTF8
Add-Content "$env:APPDATA\EmuDeck\logs\msg.log" "$progressBarUpdate# $message" -NoNewline -Encoding UTF8
Start-Sleep -Seconds 0.5
}
setMSGTemp 'Creating configuration files. please wait'
Expand Down

0 comments on commit 803070f

Please sign in to comment.