v1.15 — PowerShell edition + repo restructure
- New powershell/InstaSoftOfficeTool.ps1: single-file WPF GUI version - Same Fluent Design UI, no compilation needed - Runs on any Windows 7+ with PowerShell 5.1 (built-in) - Chrome won't flag .ps1 files as "rarely downloaded" - Auto-elevates to admin - Moved C# source to src/ subfolder - Updated .gitignore for nested bin/obj folders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using InstaSoftOfficeTool.Models;
|
||||
|
||||
namespace InstaSoftOfficeTool.Pages
|
||||
{
|
||||
public partial class ConfigPage : Page, IWizardPage
|
||||
{
|
||||
private readonly MainWindow _main;
|
||||
private readonly InstallConfig _config;
|
||||
private readonly List<CheckBox> _appCheckBoxes = new List<CheckBox>();
|
||||
|
||||
public ConfigPage(MainWindow main, InstallConfig config)
|
||||
{
|
||||
InitializeComponent();
|
||||
_main = main;
|
||||
_config = config;
|
||||
|
||||
// Restore arch
|
||||
if (_config.Architecture == "32")
|
||||
{
|
||||
Rb32.IsChecked = true;
|
||||
}
|
||||
|
||||
// Populate language combo
|
||||
foreach (var lang in LanguageList.Languages)
|
||||
{
|
||||
CbLanguage.Items.Add(new ComboBoxItem
|
||||
{
|
||||
Content = lang.Name + " (" + lang.Code + ")",
|
||||
Tag = lang.Code
|
||||
});
|
||||
}
|
||||
|
||||
// Select current language
|
||||
for (int i = 0; i < CbLanguage.Items.Count; i++)
|
||||
{
|
||||
var item = (ComboBoxItem)CbLanguage.Items[i];
|
||||
if ((string)item.Tag == _config.Language)
|
||||
{
|
||||
CbLanguage.SelectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CbLanguage.SelectedIndex < 0) CbLanguage.SelectedIndex = 0;
|
||||
|
||||
// Populate app checkboxes
|
||||
foreach (var app in ExcludableApps.Apps)
|
||||
{
|
||||
// Ha m\u00e1r van ment\u00e9s a configban, azt haszn\u00e1ljuk; k\u00fcl\u00f6nben a default\u00f6t
|
||||
bool isChecked = _config.ExcludedApps.Count > 0
|
||||
? !_config.ExcludedApps.Contains(app.Id)
|
||||
: app.DefaultChecked;
|
||||
|
||||
bool isProPlus = _config.Edition != null &&
|
||||
_config.Edition.ProductId.Contains("ProPlus");
|
||||
bool isStandard = _config.Edition != null &&
|
||||
_config.Edition.ProductId.Contains("Standard");
|
||||
|
||||
bool unavailable = false;
|
||||
if (app.MinEdition == "proplus" && !isProPlus)
|
||||
unavailable = true;
|
||||
else if (app.MinEdition == "standard+" && !isProPlus && !isStandard)
|
||||
unavailable = true;
|
||||
|
||||
var cb = new CheckBox
|
||||
{
|
||||
Content = app.DisplayName,
|
||||
IsChecked = unavailable ? false : isChecked,
|
||||
IsEnabled = !unavailable,
|
||||
Tag = app.Id,
|
||||
Style = (Style)FindResource("FluentCheckBox"),
|
||||
Margin = new Thickness(0, 4, 24, 4),
|
||||
MinWidth = 160
|
||||
};
|
||||
_appCheckBoxes.Add(cb);
|
||||
AppCheckBoxes.Children.Add(cb);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
_config.Architecture = Rb64.IsChecked == true ? "64" : "32";
|
||||
|
||||
if (CbLanguage.SelectedItem is ComboBoxItem selected)
|
||||
{
|
||||
_config.Language = (string)selected.Tag;
|
||||
}
|
||||
|
||||
_config.ExcludedApps.Clear();
|
||||
foreach (var cb in _appCheckBoxes)
|
||||
{
|
||||
if (cb.IsChecked != true || !cb.IsEnabled)
|
||||
{
|
||||
_config.ExcludedApps.Add((string)cb.Tag);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user