# Stop service
stop
{
	error=warning
	module=service
}

# Wait for all previously signalled programs to stop
waitstop
{
	error=fatal
	timeout=60
	kill=no
}

# Install openit_appusage.exe first based on processor architecture
# Install 64bit appusage
install
{
 error=fatal
 condition=arch # 64
 source=bin/openit_appusage_64.exe
 target=%installdir%\bin\openit_appusage.exe
}

# Install 32bit appusage
install
{
 error=fatal
 condition=arch !# 64
 source=bin/openit_appusage_32.exe
 target=%installdir%\bin\openit_appusage.exe
}

# If wmic is available, install appusage again based on OS architecture
run
{
	error=warning
	source=runbatch.oms
	timeout=300
}

install
{
	error=fatal
	source=conf/agent.mess
	target=%installdir%/Configuration/LogMessages/agent.mess
}

install
{
	error=fatal
	source=conf/agent.desc
	target=%installdir%/Configuration/LogMessages/agent.desc
}

install
{
	error=fatal
	source=conf/appusage.mess
	target=%installdir%/Configuration/LogMessages/appusage.mess
}

install
{
	error=fatal
	source=conf/appusage.desc
	target=%installdir%/Configuration/LogMessages/appusage.desc
}

# Start service
start
{
	error=warning
	module=service
}