/build/static/layout/Breadcrumb_cap_w.png

Wise Script help: concurrent running of msi and detecting process

I am trying to do the following via wise script but dont know how to do it.
There is a msi that i run in my script. That msi calls a process X when its almost done. I need to kill that process X once it starts. How do I do this. I have to run the msi concurrently while detecting process X.
Any help would be greatly appreciated.

0 Comments   [ + ] Show comments

Answers (2)

Posted by: TomB 19 years ago
Orange Belt
0
I do not know about wise script, but there are a couple things you can do outside of wise script.

1. You can find the CustomAction (if it is a CA) that spawns the process in the MSI and using a MST file you can remove it from the InstallExecuteSequence (or UI) Table.

2. Create your own CustomAction that calls a vbs script stored in a binary table. Then schedule this in the InstallExecuteSequence Table right after InstallFinalize (or the CA that starts the process). You could also make this an MST file.

Sample Script
=================

Function EndProcess()
Dim ProcessName
Dim colResults, objProcess, objWMI, strWQL

ProcessName="x"

Set objWMI = GetObject("winmgmts:Root/CIMv2")
strWQL = "SELECT * FROM Win32_Process WHERE Name = '" & ProcessName & "'"
Set colResults = objWMI.ExecQuery(strWQL)
For Each objProcess In colResults
objProcess.Terminate
Next
End Function
=================

Hope that helps [:D]
Posted by: Garrett 19 years ago
Orange Belt
0
This is paired down from a larger script. You may need to tweak it a bit for variable names.

Rem Purpose: Chain two MSI installations together
The reg key below is present while an MSI is running
Get Registry Key SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\InProgress place in Variable INPROGRESS
Rem Set default to install the first msi
Set Variable INSTALLMSIONE to Yes
Rem Set variables for both msi files
Rem Change to appropriate folder on the P:\ drive and .msi filename
Set Variable MSIONE to Package Source Director\MSI Name.msi
Set Variable MSITWO to Package Source Director\MSI Name.msi

If INSTALLMSIONE Equals "Yes" then
Rem /QB- installs Quietly with Basic UI, no prompts displayed
Execute %SYS%\msiexec.exe /I "%PkgSrc%\%MSIONE%" /QB- (Wait)
End

Rem This registry key is only present while an MSI is running
While INPROGRESS Not Equal "" loop
Get Registry Key SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\InProgress place in Variable INPROGRESS
End

Rem /QB- installs Quietly with Basic UI, no prompts displayed
Execute %SYS%\msiexec.exe /I "%PKGSRC%\%MSITWO%" /QB-

Use below to copy/paste into WiseScript:

item: Remark
Text= Purpose: Chain two MSI installations together
end
item: Get Registry Key Value
Variable=INPROGRESS
Key=SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\InProgress
Flags=00000100
end
item: Remark
Text= Set default to install the first msi
end
item: Set Variable
Variable=INSTALLMSIONE
Value=Yes
end
item: Remark
Text= Set variables for both msi files
end
item: Remark
Text= Change to appropriate folder on the P:\ drive and .msi filename
end
item: Set Variable
Variable=MSIONE
Value=Package Source Director\MSI Name.msi
end
item: Set Variable
Variable=MSITWO
Value=Package Source Director\MSI Name.msi
end
item: Remark
end
item: If/While Statement
Variable=INSTALLMSIONE
Value=Yes
end
item: Remark
Text= /QB- installs Quietly with Basic UI, no prompts displayed
end
item: Execute Program
Pathname=%SYS%\msiexec.exe
Command Line=/I "%PkgSrc%\%MSIONE%" /QB-
Flags=00000010
end
item: End Block
end
item: Remark
end
item: Remark
Text= This registry key is only present while an MSI is running
end
item: If/While Statement
Variable=INPROGRESS
Flags=00010001
end
item: Get Registry Key Value
Variable=INPROGRESS
Key=SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\InProgress
Flags=00000100
end
item: End Block
end
item: Remark
end
item: Remark
Text= /QB- installs Quietly with Basic UI, no prompts displayed
end
item: Execute Program
Pathname=%SYS%\msiexec.exe
Command Line=/I "%PKGSRC%\%MSITWO%" /QB-
end
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ