eDosStation/SyncToSqlsrv7.ps1
2026-08-27 12:55:46 +02:00

64 lines
3.2 KiB
PowerShell

$DestPath = "\\sqlsrv7\c$\soft\eDos2026"
$SourcePath="D:\l\src\cs2025\eDosStation"
$SourcePathTools="D:\l\src\cs2025\LSWTools"
$DistributePath="D:\Soft\Distribute"
$TWN4DevPackPath="D:\Soft\TWN4DevPack480"
if ($env:COMPUTERNAME -eq "T16LUC") {
$SourcePath = "C:\l\src\eDosStation"
$TWN4DevPackPath="C:\l\TWN4\TWN4DevPack520"
$SourcePathTools="C:\l\src\LSWTools"
$DestPath = "C:\l\Edos2026"
$DistributePath="c:\L\Distribute"
}
$ScriptPath="$SourcePath\scripts"
$cert = get-childitem -path cert:\CurrentUser\My\857150b64ef7d3e679c8cbde425d2a0b5e58ffaa
Export-Certificate -Force -FilePath "$DestPath\signertrust.cer" -Cert $cert
Set-AuthenticodeSignature -FilePath "$ScriptPath\Upgrader.ps1" -Certificate $cert -TimestampServer "http://timestamp.digicert.com"
Set-AuthenticodeSignature -FilePath "$ScriptPath\installatie.ps1" -Certificate $cert -TimestampServer "http://timestamp.digicert.com"
Set-AuthenticodeSignature -FilePath "$ScriptPath\installatie2.ps1" -Certificate $cert -TimestampServer "http://timestamp.digicert.com"
compress-archive -force -Path "$SourcePath\syncEdosLocal\bin\Release\*.*" -DestinationPath "$DestPath\eDosSync.zip"
compress-archive -force -Path "$SourcePath\eDosStation\bin\Release\*.*" -DestinationPath "$DestPath\eDosStation.zip"
Copy-Item -Path "$ScriptPath\*.cmd" -Destination "$DestPath"
Copy-Item -Path "$ScriptPath\ConfigurationFile.ini" -Destination "$DestPath"
Copy-Item -Path "$ScriptPath\eDosStation.pub" -Destination "$DestPath"
Copy-Item -Path "$ScriptPath\authorized_keys" -Destination "$DestPath\authorized_keys"
Copy-Item -Path "$ScriptPath\Upgrader.ps1" -Destination "$DestPath\Upgrader.ps1"
Copy-Item -Path "$ScriptPath\installatie.ps1" -Destination "$DestPath\installatie.ps1"
Copy-Item -Path "$ScriptPath\installatie2.ps1" -Destination "$DestPath\installatie2.ps1"
Copy-Item -Path "$ScriptPath\eDosSync.xml" -Destination "$DestPath"
Copy-Item -Path "$ScriptPath\*.cer" -Destination "$DestPath"
Copy-Item -Path "$ScriptPath\UpdateSql.cmd" -Destination "$DestPath"
Copy-Item -Path "$ScriptPath\sqlreg.reg" -Destination "$DestPath"
#nodig ?
Copy-Item -Path "$ScriptPath\*.sql" -Destination "$DestPath"
#updates
Copy-Item -Path "$SourcePath\eDosLocal\UpdateLocal.sql" -Destination "$DestPath\UpdateLocal.sql"
Copy-Item -Path "$SourcePath\eDosLocal\Updates.sql" -Destination "$DestPath\Updates.sql"
Copy-Item -Path "$SourcePathTools\LogFolderClean\bin\Release\logFolderClean.exe" -Destination "$DestPath\LogFolderClean.exe"
Copy-Item -Path "$SourcePathTools\LogFolderClean\bin\Release\logFolderClean.exe.config" -Destination "$DestPath\LogFolderClean.exe.config"
Copy-Item -Path "$DistributePath\OpenSSH\OpenSSH10p2Signed.zip" -Destination $DestPath
Copy-Item -Path "$TWN4DevPackPath\Tools\flash.exe" -Destination $DestPath
Copy-Item -Path "$DistributePath\Elatec\TWN4_xCx480_EDOS100_Edos_Badge_Reader.bix" -Destination $DestPath
write-host "Files are copied to $DestPath"
write-host "Source files from $SourcePath\syncEdosLocal\bin\Release are zipped to $DestPath\eDosSync.zip"
write-host "Source files from $SourcePath\eDosStation\bin\Release are zipped to $DestPath\eDosSync.zip"
Sleep 10
exit