Skip to content

Commit

Permalink
- fixed windows build script
Browse files Browse the repository at this point in the history
- added pywin32 requirement
  • Loading branch information
EchterAlsFake committed Dec 7, 2024
1 parent 66e7b82 commit 2ec7ee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PySide6
requests
hue_shift
Markdown
rich
tqdm
rich # Only needed by CLI
ffmpeg-progress-yield
mutagen
mutagen
pywin32 # Only needed on Windows for Porn Fetch installation
18 changes: 7 additions & 11 deletions src/scripts/install_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti

$userDir = [Environment]::GetFolderPath('UserProfile')
$desktopDir = [System.IO.Path]::Combine($userDir, "Desktop")
$tempDir = [System.IO.Path]::GetTempPath()

# Define the downloads directory
$downloadsDir = "$env:TEMP"
Expand Down Expand Up @@ -77,29 +76,26 @@ Write-Host "NUITKA_ASSUME_YES_FOR_DOWNLOADS is set to $env:NUITKA_ASSUME_YES_FOR

# Invoke the UI update script
Write-Output "Running UI update script..."
$uiUpdateScriptPath = Join-Path -Path $PSScriptRoot -ChildPath "src/frontend/update.ps1"
$uiUpdateScriptPath = Join-Path -Path $projectDir -ChildPath "src/frontend/update.ps1"
if (Test-Path -Path $uiUpdateScriptPath) {
& $uiUpdateScriptPath
} else {
Write-Error "UI update script not found at $uiUpdateScriptPath. Please ensure it exists."
exit 1
}

pyside6-deploy main.py -c src/build/pysidedeploy_windows.spec -f -v
Set-Location -Path $projectDir
pyside6-deploy -c src/build/pysidedeploy_windows.spec -f -v

# Move the final executable to the user's Desktop
$finalExePath = Join-Path -Path $projectDir -ChildPath "main.exe"
$renamedExe = Join-Path -Path $projectDir -ChildPath "Porn Fetch.exe"
if (Test-Path -Path $finalExePath) {
Rename-Item -Path $finalExePath -NewName "Porn Fetch.exe"
Move-Item -Path $renamedExe -Destination (Join-Path $desktopDir "Porn Fetch.exe")
}
Move-Item -Path $renamedExe -Destination (Join-Path $desktopDir "Porn Fetch.exe")

#Set-Location -Path $userDir
# Clean up
deactivate
cd C:\ # Just leaves the directory, so that I can remove the downloaded archive
Set-Location C:\ # Just leaves the directory, so that I can remove the downloaded archive
Write-Output "Cleaning up..."
Remove-Item -Path $projectZipPath -Force
Remove-Item -Recurse -Force -Path (Join-Path $downloadsDir "Porn_Fetch-master")
Write-Output "Done!"
Write-Output "Porn Fetch is now on your Desktop. It's named 'Porn Fetch.exe'"
Write-Output "You can now close the terminal..."

0 comments on commit 2ec7ee8

Please sign in to comment.