Skip to content

"add save files" and "add ps2exe-script update" implementation#41

Open
emgeiger wants to merge 12 commits into
Hope-IT-Works:mainfrom
emgeiger:copilot/start-implementation
Open

"add save files" and "add ps2exe-script update" implementation#41
emgeiger wants to merge 12 commits into
Hope-IT-Works:mainfrom
emgeiger:copilot/start-implementation

Conversation

@emgeiger

Copy link
Copy Markdown

This pull request adds support for saving and loading configuration files in the PS2EXE-GUI, as well as a feature to check for and update the ps2exe.ps1 script directly from the GUI. It also updates the README to reflect these completed features and improves the usability of the File and Help menus. The most important changes are:

New Features: Configuration Save/Load

  • Implemented functions to create a new config, save the current config, save as a new config, and open an existing config file, all using JSON format and integrated into the File menu. (src/PS2EXE-GUI.ps1)
  • Added global variables for config paths, filters, keys, and defaults to support configuration management. (src/PS2EXE-GUI.ps1)

New Feature: ps2exe.ps1 Update Check

  • Added a function to check for updates to ps2exe.ps1, compare hashes, prompt the user, and download or update the script as needed, with user feedback via message boxes. (src/PS2EXE-GUI.ps1)

UI/UX Improvements

  • Enabled File and Help menu items for new, open, save, save as, and update actions, and wired them to the new functions for configuration and update management. (src/PS2EXE-GUI.ps1) [1] [2]
  • Fixed a typo in the About menu entry ("P2EXE-GUI" to "PS2EXE-GUI"). (src/PS2EXE-GUI.ps1)

Documentation

  • Updated the README.md to mark the "add ps2exe-script update" and "add save files" features as complete. (README.md)

Minor Default/Behavioral Changes

  • Changed the default tab index from 2 to 0 in the data context. (src/PS2EXE-GUI.ps1)

Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Fixed
@Hope-IT-Works

Copy link
Copy Markdown
Owner

Thanks for your pull request @emgeiger!

  1. Please avoid using global variables.
    More information: AvoidGlobalVars

  2. Use the repo-local ps2exe.ps1.
    This repo runs a GitHub Action regularly to check for changes in the upstream repo of MScholtes and will automatically open a pull request to merge. This ensures that PS2EXE-GUI will support all features of the ps2exe.ps1 script at all times.

Please resolve these issues, and I'll test the changes and consider a merge.

Thanks for your work, and I'm looking forward to your changes.

Greetings
@Hope-IT-Works

Comment thread src/PS2EXE-GUI.ps1 Outdated

#region pre_code
$PS2EXE_GUI_Verbose = $true
$global:PS2EXE_GUI_ConfigPath = $null
Comment thread src/PS2EXE-GUI.ps1 Outdated
#region pre_code
$PS2EXE_GUI_Verbose = $true
$global:PS2EXE_GUI_ConfigPath = $null
$global:PS2EXE_GUI_CONFIG_FILTER = "PS2EXE-GUI Config (*.json)|*.json"
Comment thread src/PS2EXE-GUI.ps1 Outdated
$PS2EXE_GUI_Verbose = $true
$global:PS2EXE_GUI_ConfigPath = $null
$global:PS2EXE_GUI_CONFIG_FILTER = "PS2EXE-GUI Config (*.json)|*.json"
$global:PS2EXE_PS1_RAW_URL = "https://raw.githubusercontent.com/MScholtes/Win-PS2EXE/master/ps2exe.ps1"
Comment thread src/PS2EXE-GUI.ps1 Fixed
Comment thread src/PS2EXE-GUI.ps1 Outdated
'ui_noOutput','ui_noError','ui_noVisualStyles','ui_exitOnCancel',
'ui_DPIAware','ui_winFormsDPIAware','ui_requireAdmin','ui_supportOS','ui_virtualize','ui_longPaths'
)
$global:PS2EXE_GUI_DEFAULTS = [ordered]@{
Comment thread src/PS2EXE-GUI.ps1 Outdated
}

function Invoke-UI_SaveConfig {
if($null -ne $global:PS2EXE_GUI_ConfigPath){
Comment thread src/PS2EXE-GUI.ps1 Outdated

function Invoke-UI_SaveConfig {
if($null -ne $global:PS2EXE_GUI_ConfigPath){
Invoke-PS2EXEGUI_SaveConfig -FilePath $global:PS2EXE_GUI_ConfigPath
Comment thread src/PS2EXE-GUI.ps1 Outdated
}

function Invoke-UI_SaveAsConfig {
$FilePath = Invoke-PS2EXEGUI_SaveFileDialog -Filter $global:PS2EXE_GUI_CONFIG_FILTER
Comment thread src/PS2EXE-GUI.ps1 Outdated
}

function Invoke-UI_OpenConfig {
$FilePath = Invoke-PS2EXEGUI_OpenFileDialog -Filter $global:PS2EXE_GUI_CONFIG_FILTER
Comment thread src/PS2EXE-GUI.ps1 Outdated
if($PS2EXE_GUI_Verbose){ Write-Host "[Invoke-PS2EXEGUI_CheckPS2EXEUpdate]" }
$TempFile = (New-TemporaryFile).FullName
try {
Invoke-WebRequest -Uri $global:PS2EXE_PS1_RAW_URL -OutFile $TempFile -UseBasicParsing
Copilot AI and others added 5 commits June 23, 2026 20:58
Adding extra Switch option to the commandlet 'Copy-item', -ErrorAction Stop, and compares file hashes to confirm the file copied correctly.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

5 participants