Skip to content

[Feature Request]: Mod that stops an install if its in use #988

@user1722

Description

@user1722

The request

For example i could update Postgres with this tool but if a Software ist running at the same time that uses the database it will be problematik for the user
Same with open Teamviewer sessions etc
A suggestion for the Preinstall or maybe a other mod name, to Check if it runs ok and only then run the script and install the update so it catches the time the user is not using the software for the install. And in the other cases just stops the install

#If PreInstall script exist
if ($ModsPreInstall) {
	Write-ToLog "Modifications for $($app.Id) before upgrade are being applied..." "Yellow"
	try {
		& "$ModsPreInstall"
		if ($LASTEXITCODE -ne 0) {
			throw "PreInstall script exited with code $LASTEXITCODE"
		}
	}
	catch {
		Write-ToLog "PreInstall for $($app.Id) failed: $_" "Red"

		# Benachrichtigung über Fehler senden
		$Title = $NotifLocale.local.outputs.output[4].title -f $($app.Name)
		$Message = "Das Preinstall-Modul für $($app.Name) wurde mit Fehler abgebrochen: $_"
		$MessageType = "error"
		$Balise = $($app.Name)
		Start-NotifTask -Title $Title -Message $Message -MessageType $MessageType -Balise $Balise -Button1Action $ReleaseNoteURL -Button1Text $Button1Text

		return  # Bricht die Funktion vollständig ab
	}
}

Is your feature request related to a problem?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions