Multiple instances of Appdeploy

Hello,
We use the postpone (Show-installationwelcome) to deploy the apps with scheduled tasks.
My problem is that multiple instances of Appdeploy can be launched.
How to block another launch if a postpone is already running.

Does this possibility exist natively?

Do not run deploy-application.exe if this process is already open.![

I tried this command without success in pre-installation :
if (get-process “Deploy-application” -ErrorAction SilentlyContinue) { exit }

Thanks for your feedback

No, this feature has not been implemented yet.

You can’t really test Deploy-Application because one is running for your powershell session also.
Could create a temp file and remove it at the end. Ofc prior to that you would always test whether it exists and exit if not.

Hello luki,
I tried with a registry key.
It works if the script continues to run.

PRE-INSTALLATION :

[string]$installPhase = 'Pre-Installation'
		
## Check registry key AppDeploy :
		$RegCheck = "HKLM:\SOFTWARE\PSAppDeployToolkit\DeferHistory\IN_PROGRESS"

		if (! (Test-path $RegCheck)) {
		New-Item $RegCheck  -Force
		New-ItemProperty $RegCheck -Name 'Install' -Value '1' }
		else { exit }

POST-INSTALLATION :

## Delete registry key AppDeploy :
		Remove-RegistryKey -Key $RegCheck -recurse

BUT, If the user defers, the registry key is not deleted.
In the main.ps1, i added this line in the “exit-script” function.

and it’s done :slight_smile:

I will do some more testing, and check that it works with all return codes.
I think, it is not recommended to modify the main.ps1 file.
Thank you for your help.