Page 1 sur 1

[RESOLU] tis-withsecure-agent-desktop et paramètres MSI

Publié : 11 juin 2025 - 11:34
par pierre.briec
Bonjour,

je souhaite avoir quelques informations concernant le paquet tis-withsecure-agent-desktop.
Je me casse les dents sur la paramètres MSI et comment les intégrer au paquet.
Dans le setup.py, j'ai bien modifié comme suit:

properties={
"VOUCHER": "xxxx-xxxx-xxxx-xxxx-xxxx"
#"UNIQUE_SIGNUP_ID": "smbios"
}

Malheureusement, si je tente d'ajouter un autre paramètre, l'installation échoue après regénération du paquet
Quelqu'un peut il m'aider là dessus? merci d'avance
Pierre

Re: tis-withsecure-agent-desktop et paramètres MSI

Publié : 11 juin 2025 - 13:27
par blemoigne
Bonjour,
avez-vous séparé les "properties" par des virgules ?

Code : Tout sélectionner

properties={
"VOUCHER": "xxxx-xxxx-xxxx-xxxx-xxxx",
"UNIQUE_SIGNUP_ID": "smbios"
}

Re: tis-withsecure-agent-desktop et paramètres MSI

Publié : 16 juin 2025 - 10:14
par blemoigne
Bonjour,
le problème est-il résolu ?

Re: tis-withsecure-agent-desktop et paramètres MSI

Publié : 17 juin 2025 - 09:34
par t.heroult
Pour WithSecure, j'utilise un script powershell fourni par WithSecure.
Mon paquet ne comporte donc que le fichier InstallWithSecure_S1.ps1 et l'install du setup.py ne contient que la ligne :

Code : Tout sélectionner

run('Powershell -WindowStyle Hidden -ExecutionPolicy ByPass -File "InstallWithSecure_S1.ps1"')
Voici le contenu du script (il faut juste modifier le numéro de série).

Code : Tout sélectionner

Clear-Host
# =======================================================
#  ********** Variables
# =======================================================

$dossierinstall = "c:\windows\temp\"
$CP = "installer"

$serie = "XXXX-XXXX-XXXX-XXXX-XXXX"
$valeur = (Get-ItemProperty -Path "HKLM:\SOFTWARE\MIcrosoft\Windows NT\CurrentVersion"  -Name ProductName).ProductName

if ($valeur -like "*Server*") {
    $serie = "XXXX-XXXX-XXXX-XXXX-XXXX"
}

$fsecurecp = $dossierinstall + $CP + ".exe"

# =======================================================
# ********** Verification deja installe
# =======================================================

$WantFile1 = "C:\Program Files (x86)\F-Secure\PSB\fshoster32.exe"
$WantFile2 = "C:\Program Files\F-Secure\PSB\fshoster32.exe"
$FileExists1 = Test-Path $WantFile1
$FileExists2 = Test-Path $WantFile2

if ( $FileExists1 -eq $True ) { Exit }
if ( $FileExists2 -eq $True ) { Exit }

# =======================================================
# ********** Telechargement
# =======================================================

$FileExists = Test-Path $dossierinstall
If ($FileExists -eq $False) { New-Item -path $dossierinstall -ItemType directory }

$ChkFile = $fsecurecp
$FileExists = Test-Path $ChkFile

If ($FileExists -eq $False) {
    Invoke-WebRequest -Uri http://download.withsecure.com/PSB/latest/ElementsAgentInstaller.exe -OutFile "$fsecurecp"
}

# =======================================================
# ********** D�sinstallation S1
# =======================================================

$ProcessSA = Get-Process SentinelAgent -ErrorAction SilentlyContinue
if ($ProcessSA) {
	#Check Administrator Privilege
	$user = [Security.Principal.WindowsIdentity]::GetCurrent();
	$admin=(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)  

	if ($admin -eq $false) {
		"Please run the script as Administrator"
		Start-Sleep -s 10
	}

	#Define the API Token
	#To automate the script, get the API Token from management, enter it here, and save the script.
	$token = "eyJraWQiOiJldS1jZW50cmFsLTEtcHJvZC0wIiwiYWxnIjoiRVMyNTYifQ.eyJzdWIiOiJ0Lmhlcm91bHRAbGFub3JtYW5kaXNlLmZyIiwiaXNzIjoiYXV0aG4tZXUtY2VudHJhbC0xLXByb2QiLCJkZXBsb3ltZW50X2lkIjoiMTMxNDEiLCJ0eXBlIjoidXNlciIsImV4cCI6MTc0MjQ1OTg5OCwiaWF0IjoxNzM5ODY3ODk4LCJqdGkiOiI4MmY2ZWNhNC05MTdkLTQxZmUtYmE1OS1mODljZTg5NWQzZTUifQ.9aIQtmwoFRERy6cGJ8RxTaI6kLVEz7TPeyNWhNI4-UFX5cp8dDuvyxZ1xMKxbaqTp_eY7zKAJgwuaq8Gxut2bw"
	$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
	$headers.Add("Authorization", "APIToken $token")
	#where $token is your API token. For example, "APIToken abcdefg...."

	#Gets Management URL
	$config = & 'C:\Program Files\SentinelOne\Sentinel*\SentinelCtl.exe' config | select-string -Pattern "server.mgmtServer"
	$mgmt = $config -split ' ' | select -last 1

	#Gets passphrase for Endpoint
	$uuid = & 'C:\Program Files\SentinelOne\Sentinel*\SentinelCtl.exe' agent_id
	$passphrase_url = $mgmt + "/web/api/v2.1/agents/passphrases?uuids="+"$uuid"
	$passphrase = (Invoke-RestMethod ("$passphrase_url") -Method 'GET' -Headers $headers).data.passphrase

	#Start the Uninstallation
	Write-Host "Starting Uninstallation Process..." 
	Write-Host "This Process may take a while. Please do not close the Window."
	& 'C:\Program Files\SentinelOne\Sentinel*\uninstall.exe' /uninstall /norestart /q /k "$passphrase"
}

# =======================================================
# ********** Install
# =======================================================

$Command_line='"' + $fsecurecp + '"'
Start-Process -FilePath $Command_line -Wait -ArgumentList "--silent", "--voucher $serie", '--skip-sidegrade "*"'

Re: tis-withsecure-agent-desktop et paramètres MSI

Publié : 10 juil. 2025 - 15:09
par dcardon
Salut Thomas,

c'est amusant, le script que tu as publié fait automatiquement la désinstallation de SentinelOne en récupérant le mdp de désinsallation auprès du serveur de management sentinelone...

et ça fait aussi le téléchargement de withsecure si besoin.

Donc en gros le paquets wapt fournit devrait faire l'affaire si la valeur VOUCHER est correctement remplie

Cordialement,

Denis