# Process Order

Install-mode only. Multiline allowed. Place commands, components, directives (see below), setup, or install package(s) here with proper silent install switches or script(s) to automate the install. Mainly for ssApps, but can be used with ppApps/ppGames for any post-install or preprocessing commands, script(s), or registry entries.

Status: Recommended for ssApps. Optional for ppApps/ppGames.

Some examples:

example1:

In this example we using an app that has a silent switch

setup.msi /qb

use of directives

%WaitForIt% "%ProgramsCommon%\TestStartmenu.lnk"

%ProcessKill% "Notepad.exe"

%AddonInstaller% "%SourcePath%\Test_addon.7z"

using %AddToHosts% to block websites
%AddToHosts% "127.0.0.1 secure.example.com"

here is extracting files to a specific location
%Extract% "Extras.rar" -o"%SystemRoot%\temp"

making a directory and execute a cmd file
md "%ProgramFiles%\Something" #CMD#

execute a sile install with parametrs
"7z920-x64.msi" /qb #Is_x64#

import a reg file
ImportTest.reg

executing a specific script file
ScriptTest.cmd

example2

in this example the contents of the registry section, using #ApplyRegistry# is applied first before running script #RunScript#
as there maybe an instance when a correction to a path is required before application is installed
#applypatch# could be used to replace an existing file that has been modified
this can be achieved by placing the file in a subdirectory of the working directory named 'patch'
all files in the patch subdirectory will be extracted and placed in the install-to path

#ApplyRegistry#
#RunScript#
#ApplyPatch#

example3

Normally an Apz will be elevated to Admin in order to install
but you may need to force the app to have Admin privileges

if so then by placing the following script in the cmd section
and place your commands after:
REM put here code as you like

code starts here

#####################################################################

:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B
:gotPrivileges
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
setlocal & pushd .
REM put here code as you like

#####################################################################

code end here

or elevate before executing the install by using the registry

code starts here

#####################################################################

@echo off
reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~dp0PlantsVsZombies.exe" /d "~ RUNASADMIN" /f

#####################################################################

code end here

example4

there are applications that after installing they will open a welcome screen

in this case GitHubDesktop opens a welcome screen which needs to be closed
this can be achieved by using %ProcessKill% and by using ping as a delay to ensure the process is killed
using it twice should be enough in order for it to work.

In order to find out which process to terminate install the application normally and when the welcome screen pops up open the task manager and examine the process name and select end task to test. Then use the name in the script in this case it is GitHubDesktop.exe.

rem App name: GitHubDesktop

ping 127.0.0.1 -n 4 -w 1000

%ProcessKill% "GitHubDesktop.exe"

ping 127.0.0.1 -n 4 -w 1000

%ProcessKill% "GitHubDesktop.exe"

Ξ Some Notes:

1. Use the process-order #Directives# here to control or fine-tune the assembly process.
2. The <Assembly> section is ignored in Regen-mode.
3. With the exception of %Extract%, the <Assembly> section uses the %Components% in their internal/built-in forms.

See also:

Assembly Sequence

Install and Regen modes

Automatic Variable Substitution Chart

Copyright © 2020, Vergitek Solutions

ssTek Forum: Tools for custom Operating Systems!