Skip to content

Instantly share code, notes, and snippets.

@gioxx
Last active October 19, 2023 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gioxx/13351e4cc1a4514dc6b44cb3d859a45f to your computer and use it in GitHub Desktop.
Save gioxx/13351e4cc1a4514dc6b44cb3d859a45f to your computer and use it in GitHub Desktop.
(Non funziona più, vedi commenti) Script di installazione GoSign Desktop scaricando il pacchetto più aggiornato dal sito web ufficiale e personalizzando gli argomenti passati all'installer. Articolo sul blog: https://go.gioxx.org/udiup
<#
GSolone, 2023
Credits:
https://stackoverflow.com/a/44337588
Changes:
7/7/23- Improve: I provide for download-only capability via script with parameter -DownloadOnly (without installation).
Change: removed pause command, if I download the installation package I will proceed and notify on screen.
#>
param(
[Parameter(Mandatory=$False, HelpMessage="Download GoSign Desktop without installing")]
[switch] $DownloadOnly
)
function downloadMSI($fileURL,$filePath) {
Invoke-WebRequest -uri $fileURL -OutFile $filePath
$MSIfile = Get-ChildItem -Path $filePath -File -Filter '*.ms*'
Write-Host "MSI found: $($MSIfile)"
return $MSIfile
}
function installMSI($MSIfile) {
$checkFile = Test-Path $MSIfile -IsValid
$today = Get-Date -Format yyyyMMddTHHmmss
$logFile = '{0}-{1}.log' -f $MSIfile.fullname,$today
$MSIArguments = @(
"/i"
('"{0}"' -f $MSIfile.fullname)
"ALLUSERS=1"
"APPLICATIONFOLDER=`"$env:ProgramFiles\InfoCert\GoSign Desktop`""
"/quiet"
"/qn"
"/norestart"
"/log"
$logFile
)
if ( $checkFile -eq $True ) {
Write-Host "Installation started: `nmsiexec.exe $($MSIArguments)" -f "Yellow"
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Passthru | Wait-Process
Write-Host "Finished installation $($MSIfile)" -f "Green"
Remove-Item $MSIfile.fullname -Confirm:$false
} else {
Write-Host "File not found." -f "Red"
}
}
if (!($DownloadOnly)) {
$MSIfile = downloadMSI "https://rinnovofirma.infocert.it/gosign/download/win32/latest/" "$env:TEMP\GoSign-Desktop-installer-win32.msi"
installMSI $MSIfile
} else {
if (!(Test-Path "C:\Temp")) { New-Item "C:\Temp" -ItemType Directory }
$MSIfile = downloadMSI "https://rinnovofirma.infocert.it/gosign/download/win32/latest/" "C:\Temp\GoSign-Desktop-installer-win32.msi"
}
@fastleo63
Copy link

Ho provato oggi, 04/10/2023, ad usare lo script, con il paramtero -DownloadOnly, ma il file MSI scaricato è risultato non essere eseguibile.
Compare il messaggio che è "impossibile aprire il pacchetto di installazione..."
Se si ridenomina il file cambiando l'estensione da MSI ad EXE, il file di setup viene invece eseguito correttamente.
Ho contemporaneamente notato che, se si effettua il download della versione più recente (la 2.0.2) dalla pagina web del sito di InfoCert, il file di installazione non è più GoSign-Desktop-installer-win32.msi, ma un GoSign-Desktop-installer-win32.exe.
Quindi InfoCert ha rimosso la versione MSI, ed ora si può usare solo l'EXE...

@gioxx
Copy link
Author

gioxx commented Oct 4, 2023

Ciao @fastleo63 e grazie per avermi avvisato, in azienda stiamo dismettendo GoSign in favore di Firma4NG (a causa delle scelte discutibili che sta operando Infocert negli ultimi tempi) e non avevo notato questa "novità" (ulteriormente sgradevole).
Ho provato, confermo tutto e quindi direi che lo script andrebbe modificato per lavorare con l'exe anziché con il MSI, ma dovrei andare a verificare la validità dei parametri passati da riga di comando.

Metto in canna, spero di poterci dare un'occhiata in tempi brevi.

@gioxx
Copy link
Author

gioxx commented Oct 19, 2023

Ho pubblicato un aggiornamento dell'articolo originale sul blog ma non un aggiornamento dello script perché non vale la pena per quel poco di differenza che fa rispetto allo scaricare e installare manualmente il nuovo pacchetto Squirrel, spiace davvero per questo cambio di rotta da parte di Infocert ma ce ne si farà una ragione (passando a un'alternativa): https://gioxx.org/2023/08/02/powershell-installazione-di-gosign-desktop-per-tutti-gli-utenti/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment