Skip to content

Commit e02cedc

Browse files
author
Pedro Maldonado
committed
Library glpk added for proper installation
1 parent 2eda3b0 commit e02cedc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

install_gplk.ps1

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Set proper execution policy
2+
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
3+
4+
# Define the URL of the file to download
5+
$sourceUrl = "https://github.com/pmaldona/pyRN/raw/main/glpk-4.65.zip"
6+
7+
# Define the temporary location to store the downloaded file and the
8+
extraction folder
9+
$tempLocation = "$env:TEMP\glpk-4.65.zip"
10+
$extractedFolder = "$env:TEMP\glpk-4.65"
11+
12+
# Define the destination system folder
13+
$systemFolder = "${env:SystemRoot}\System32"
14+
15+
# Download the file
16+
Invoke-WebRequest -Uri $sourceUrl -OutFile $tempLocation
17+
18+
# Extract the contents of the zip file
19+
Expand-Archive -Path $tempLocation -DestinationPath $extractedFolder
20+
21+
# Copy the files from the w64 folder to the system folder
22+
$sourceFiles = Get-ChildItem -Path "$extractedFolder\w64" -Recurse
23+
$sourceFiles | ForEach-Object {
24+
$destinationPath = Join-Path $systemFolder
25+
$_.FullName.Substring($extractedFolder.Length + 4)
26+
Write-Output $destinationPath
27+
# Copy-Item -Path $_.FullName -Destination $destinationPath
28+
-Force
29+
Copy-Item -Path $_.FullName -Destination $systemFolder -Force
30+
31+
}
32+
33+
# Clean up - delete the temporary files and folder
34+
Remove-Item $tempLocation -Force
35+
Remove-Item $extractedFolder -Recurse -Force
36+
37+
Write-Host "glpk-4.65 files copied to the system folder."
38+

0 commit comments

Comments
 (0)