Mise en place maj auto

This commit is contained in:
2026-03-31 17:13:19 +02:00
parent 9f3928e584
commit c04c7e848b
17 changed files with 4 additions and 4 deletions

View File

@@ -1,42 +0,0 @@
$source = "\\mj91.fr\PyCharm\Ratio_Inventaires\Excel\prod"
$dest = "C:\Users\$env:USERNAME\Domo91"
$nomFichier = "Ratio_Cuisine.xlsm"
$nomVersion = "Ratio_Cuisine_VERSION.txt"
$sourceXlsm = Join-Path $source $nomFichier
$sourceVersion = Join-Path $source $nomVersion
$destXlsm = Join-Path $dest $nomFichier
$destVersion = Join-Path $dest $nomVersion
if (!(Test-Path $dest)) {
New-Item -ItemType Directory -Path $dest -Force | Out-Null
}
if (!(Test-Path $sourceVersion)) {
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show("Le dossier de mise à jour sur le NAS est inaccessible.", "Mise à jour Ratio Cuisine")
exit
}
$versionServeur = (Get-Content $sourceVersion -ErrorAction Stop).Trim()
if (Test-Path $destVersion) {
$versionLocale = (Get-Content $destVersion -ErrorAction SilentlyContinue).Trim()
} else {
$versionLocale = ""
}
if ($versionServeur -ne $versionLocale) {
$excel = Get-Process EXCEL -ErrorAction SilentlyContinue
if ($excel) {
$excel | Stop-Process -Force
Start-Sleep -Seconds 2
}
Copy-Item -Path $sourceXlsm -Destination $destXlsm -Force
Copy-Item -Path $sourceVersion -Destination $destVersion -Force
}
Start-Process $destXlsm

View File

@@ -1,2 +0,0 @@
@echo off
powershell -ExecutionPolicy Bypass -File "%~dp0Maj_Ratio_Cuisine.ps1"

View File

@@ -1,2 +0,0 @@
@echo off
powershell -ExecutionPolicy Bypass -File "%~dp0Maj_Ratio_Restauration.ps1"

Binary file not shown.

View File

@@ -1,2 +1,2 @@
4.2.66
2026-03-18
4.2.71
2026-03-23

Binary file not shown.

View File

@@ -1,2 +1,2 @@
2.1.39
2026-03-18
2.1.43
2026-03-23

View File

@@ -1,42 +0,0 @@
$source = "\\mj91.fr\PyCharm\Ratio_Inventaires\Excel\prod"
$dest = "C:\Users\$env:USERNAME\Domo91"
$nomFichier = "Ratio_Restauration.xlsm"
$nomVersion = "Ratio_Restauration_VERSION.txt"
$sourceXlsm = Join-Path $source $nomFichier
$sourceVersion = Join-Path $source $nomVersion
$destXlsm = Join-Path $dest $nomFichier
$destVersion = Join-Path $dest $nomVersion
if (!(Test-Path $dest)) {
New-Item -ItemType Directory -Path $dest -Force | Out-Null
}
if (!(Test-Path $sourceVersion)) {
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show("Le dossier de mise à jour sur le NAS est inaccessible.", "Mise à jour Ratio Restauration")
exit
}
$versionServeur = (Get-Content $sourceVersion -ErrorAction Stop).Trim()
if (Test-Path $destVersion) {
$versionLocale = (Get-Content $destVersion -ErrorAction SilentlyContinue).Trim()
} else {
$versionLocale = ""
}
if ($versionServeur -ne $versionLocale) {
$excel = Get-Process EXCEL -ErrorAction SilentlyContinue
if ($excel) {
$excel | Stop-Process -Force
Start-Sleep -Seconds 2
}
Copy-Item -Path $sourceXlsm -Destination $destXlsm -Force
Copy-Item -Path $sourceVersion -Destination $destVersion -Force
}
Start-Process $destXlsm