Skip to content

Microwin appinstall - #5

Closed
Real-MullaC wants to merge 12 commits into
CodingWonders:microwin-202506from
Real-MullaC:microwin-appinstall
Closed

Microwin appinstall#5
Real-MullaC wants to merge 12 commits into
CodingWonders:microwin-202506from
Real-MullaC:microwin-appinstall

Conversation

@Real-MullaC

@Real-MullaC Real-MullaC commented Aug 1, 2025

Copy link
Copy Markdown

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

Testing

Impact

Issue related to PR

  • Resolves #

Additional Information

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no errors/warnings/merge conflicts.

Real-MullaC and others added 3 commits August 1, 2025 00:15
Added quotes to the file paths. Put all the arguments in 1 string (as that also works fine)
@Real-MullaC
Real-MullaC marked this pull request as draft August 1, 2025 17:10
@Real-MullaC Real-MullaC closed this Aug 1, 2025
@Real-MullaC Real-MullaC reopened this Aug 1, 2025
Comment thread functions/microwin/Invoke-Microwin.ps1 Outdated
Comment on lines +91 to +143
# Log configuration file check
"Checking for configuration file at: $env:HOMEDRIVE\winutil-config.json" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber

if (Test-Path -Path "$env:HOMEDRIVE\winutil-config.json")
{
"Configuration file detected. Applying auto-configuration..." | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
Write-Host "Configuration file detected. Applying..."

try {
"Downloading WinUtil script from christitus.com..." | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
Invoke-RestMethod -Uri "https://christitus.com/win" -OutFile "$env:HOMEDRIVE\winutil.ps1"
"WinUtil script downloaded successfully" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber

# Properly escaped command with ampersand quoted
$cmd = '$env:HOMEDRIVE\winutil.ps1 -Config ''$env:HOMEDRIVE\winutil-config.json'' -Run'
"Prepared command: $cmd" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber

# Start WinUtil and wait for completion
"Starting WinUtil process and waiting for completion..." | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
$process = Start-Process powershell.exe -Verb RunAs -ArgumentList @(
"-NoProfile",
"-ExecutionPolicy", "Bypass",
"-Command", $cmd
) -PassThru -WindowStyle Hidden

"WinUtil process started (PID: $($process.Id)). Waiting for completion..." | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber

# Wait for the process to complete
$process.WaitForExit()
"WinUtil process completed with exit code: $($process.ExitCode)" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber

# Give a small delay to ensure all operations are complete
Start-Sleep -Seconds 3

"Cleaning up temporary files..." | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
if (Test-Path "$env:HOMEDRIVE\winutil.ps1") {
Remove-Item -Path "$env:HOMEDRIVE\winutil.ps1" -Force
"Removed winutil.ps1" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
}
if (Test-Path "$env:HOMEDRIVE\winutil-config.json") {
Remove-Item -Path "$env:HOMEDRIVE\winutil-config.json" -Force
"Removed winutil-config.json" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
}
"Cleanup completed" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
}
catch {
"Error during WinUtil auto-configuration: $($_.Exception.Message)" | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
Write-Host "Error during WinUtil auto-configuration: $($_.Exception.Message)"
}
}
else {
"No configuration file found. Skipping auto-configuration." | Out-File -FilePath "$env:HOMEDRIVE\windows\LogFirstRun.txt" -Append -NoClobber
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you really vibe-code this s...?

@CodingWonders

Copy link
Copy Markdown
Owner

This will be merged by me

@Real-MullaC
Real-MullaC deleted the microwin-appinstall branch August 2, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants