Delay or suspend Installed Managed Software by a vbscript launched in a msi
Hi everyone,
I manage several installs by GPO and for one in particular, i would like to delay (suspend) the install on startup boot.
For that, i've modified the original msi by adding 3 entries :
* add a CA entry
* add a InstallExecuteSequence entry
* add a LauchCondition entry
The CustomAction entry is a CustomAction type 38 (the target shield containts my vbscript -it's a msgbox with a timeout that offers at the user to delay or not the install. If the answer is YES, it's created on-the-fly a public PROPERTY.
here the code of the vbscript:
in InstallExecuteSequence Table, this CA is launched before LaunchCondition Sequence ID with the condition 'NOT Installed'
In LaunchCondition Table, i've created this condition : Not STATUSMSG
Results :
when i try to deploy the msi by GPO, no popup window appears -but the script is executed-.
notice : In per-User Mode, This work fine (the popup window appears) -also with the args /qb! or /qn -
Is there anyone that can help me?
Thanks in advance
I manage several installs by GPO and for one in particular, i would like to delay (suspend) the install on startup boot.
For that, i've modified the original msi by adding 3 entries :
* add a CA entry
* add a InstallExecuteSequence entry
* add a LauchCondition entry
The CustomAction entry is a CustomAction type 38 (the target shield containts my vbscript -it's a msgbox with a timeout that offers at the user to delay or not the install. If the answer is YES, it's created on-the-fly a public PROPERTY.
here the code of the vbscript:
Set WshShell = CreateObject("WScript.Shell")
Dim pdname, pdversion
pdname = Property("ProductName")
pdversion = Property ("ProductVersion")
intButton = WshShell.Popup ("Would you to delay the installation of this product : " & vbcr & pdname & " " & pdversion & vbcr & vbcr & "(Window closed in 5 seconds -No answer selected-)", 5, , 4 + 48)
select case intButton
case -1
' strMessage = "You did not click any button within the 5 seconds allowed."
case 6
' strMessage = "You clicked the YES button."
Property("STATUSMSG")="Installation aborted"
case 7
' strMessage = "You clicked the No button."
end select
in InstallExecuteSequence Table, this CA is launched before LaunchCondition Sequence ID with the condition 'NOT Installed'
In LaunchCondition Table, i've created this condition : Not STATUSMSG
Results :
when i try to deploy the msi by GPO, no popup window appears -but the script is executed-.
notice : In per-User Mode, This work fine (the popup window appears) -also with the args /qb! or /qn -
Is there anyone that can help me?
Thanks in advance
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
pgiraud
13 years ago
Posted by:
weberik
13 years ago
im not sure when and in what context the launchcondition is executed exactly, its the first thing the MSI does, but it has no default sequence ID in the sequence table.
have you tried placing the custom action somewhere else in the sequence? maybe right before "installInitialize", at that moment the installer should execute in the right context (using the user token) but didn't make changes to the system so far.
does the CA run at all? you could add some logging to check that.
a quick search on the internet will tell you how to add log entries with a vbs custom action, like:
http://zacky.cleverits.com/IT/MSI/msi_faq.htm#Add%20Line%20to%20logfile%20from%20Custom%20Action
have you tried placing the custom action somewhere else in the sequence? maybe right before "installInitialize", at that moment the installer should execute in the right context (using the user token) but didn't make changes to the system so far.
does the CA run at all? you could add some logging to check that.
a quick search on the internet will tell you how to add log entries with a vbs custom action, like:
http://zacky.cleverits.com/IT/MSI/msi_faq.htm#Add%20Line%20to%20logfile%20from%20Custom%20Action
Posted by:
anonymous_9363
13 years ago
when i try to deploy the msi by GPO, no popup window appears -by the script is executed-.GPO installs are executed by the local System account which has no console output. You'll need to re-think how you're doing this, although why you'd want users to be able to choose to delay installation is a puzzle. If it's because it's a lengthy install, they'll put it off forever (users are like that!)
Posted by:
weberik
13 years ago
silly me posting before vbscab shed light on the issue :)
i never deployed with policies and didnt know the system context is used. learning every day here.
in that case there is no simple solution for your problem.
if you MUST have this feature and can't stop using policy deployment.
to solve this problem you need to get your hands dirty and start coding something, like a service that can access the desktop/session of the user to display the popup,
then you need a wrapper or custom action that communicates with the service.
but thats a lot of work and i dont recommend it, because if you are in a environment that depends on that feature, you should using a real deployment system anyway
i never deployed with policies and didnt know the system context is used. learning every day here.
in that case there is no simple solution for your problem.
if you MUST have this feature and can't stop using policy deployment.
to solve this problem you need to get your hands dirty and start coding something, like a service that can access the desktop/session of the user to display the popup,
then you need a wrapper or custom action that communicates with the service.
but thats a lot of work and i dont recommend it, because if you are in a environment that depends on that feature, you should using a real deployment system anyway
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.