diff --git a/Install-Dependencies.ps1 b/Install-Dependencies.ps1 index 9189a0c..33b738c 100644 --- a/Install-Dependencies.ps1 +++ b/Install-Dependencies.ps1 @@ -39,31 +39,6 @@ foreach ($module in $graphModules) { } } -# Install OpenXML via NuGet package (not module) -try { - # Install NuGet package provider if not exists - if (-not (Get-PackageProvider -Name NuGet)) { - Install-PackageProvider -Name NuGet -Force - } - - # Install OpenXML SDK package - $openXmlPackage = Install-Package DocumentFormat.OpenXml -ProviderName NuGet -Force -SkipDependencies - $packagePath = Join-Path $env:USERPROFILE ".nuget\packages\DocumentFormat.OpenXml" - $dllPath = Resolve-Path (Join-Path $packagePath "*\lib\net*\DocumentFormat.OpenXml.dll") -ErrorAction SilentlyContinue | Select-Object -First 1 - - if ($dllPath -and (Test-Path $dllPath)) { - Add-Type -Path $dllPath - Write-Host "DocumentFormat.OpenXml assembly loaded successfully" -ForegroundColor Green - } - else { - throw "OpenXML DLL not found in NuGet packages. Tried path: $packagePath" - } -} -catch { - Write-Host "Failed to install DocumentFormat.OpenXml: $($_.Exception.Message)" -ForegroundColor Red - Write-Host "You may need to install the Open XML SDK manually from:" - Write-Host "https://www.microsoft.com/en-us/download/details.aspx?id=30425" -ForegroundColor Yellow -} # Check for Excel installation try { diff --git a/MainForm.ps1 b/MainForm.ps1 index d4e42c8..5fd9a34 100644 --- a/MainForm.ps1 +++ b/MainForm.ps1 @@ -2,15 +2,6 @@ Add-Type -AssemblyName System.Windows.Forms Import-Module Microsoft.Graph.Sites Import-Module Microsoft.Graph.Files -# Load Open XML assembly from installed NuGet package -try { - $openXmlPath = Join-Path $env:USERPROFILE ".nuget\packages\DocumentFormat.OpenXml\*\lib\net46\DocumentFormat.OpenXml.dll" - Add-Type -Path (Resolve-Path $openXmlPath -ErrorAction Stop) -} -catch { - [System.Windows.Forms.MessageBox]::Show("OpenXML assembly missing! Install dependencies first.") - exit -} # Import our components . "$PSScriptRoot\GraphConfig.ps1"