Advertised Software Launcher Script
My predecessor was apparently working on a script that would launch the install of all applications that had been installed as 'advertised' on a new RIS'd pc. He said that he had found it on the WEB, but I can't find anything like that anywhere.
My employer wants packaged software deployed in our managed environment as advertised shortcuts so that when users 'roam' to other pc's they can select which applications they want to install instead of waiting for everything to install at logon. This is easily done through Group Policy and Active Directory, but on a newly setup pc, they want something that will cause all the applications to install fully before the user is giving the system. This would be a script that would call all advertised applications causing them to install the same as if we sat there and clicked on each icon.
Has anyone ever come across something similar to this ?
My employer wants packaged software deployed in our managed environment as advertised shortcuts so that when users 'roam' to other pc's they can select which applications they want to install instead of waiting for everything to install at logon. This is easily done through Group Policy and Active Directory, but on a newly setup pc, they want something that will cause all the applications to install fully before the user is giving the system. This would be a script that would call all advertised applications causing them to install the same as if we sat there and clicked on each icon.
Has anyone ever come across something similar to this ?
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
Alibye77
20 years ago
This vbs script will (suposedly) install all advertised packages. I haven't tested it yet. I think it came from Microsoft technet. Enjoy...
----------------------------------------------------------------------------------------------------
Below is a script that you can use to ensure that applications are completely installed on the local machine.
This script performs a full local installation for all applications that are in the advertised state.
Note that this script will skip any application that is already partially installed.
Therefore, you should make sure this script runs soon after you advertise the application to the user.
You can deploy this script as a Group Policy logon script.
It is recommend that you run this script using Cscript. If you run it using Wscript,
you may want to remove the Wscript.echo statements so that no user intervention is required.
Ensuring Applications Are Fully Installed Locally
' Windows Installer utility to fully install advertised products
' For use with Windows Scripting Host, CScript.exe or WScript.exe
' Copyright (c) 1999, Microsoft Corporation
'
Option Explicit
'Installstates from msi.h
Const msiInstallStateNotUsed = -7
Const msiInstallStateBadConfig = -6
Const msiInstallStateIncomplete = -5
Const msiInstallStateSourceAbsent = -4
Const msiInstallStateInvalidArg = -2
Const msiInstallStateUnknown = -1
Const msiInstallStateBroken = 0
Const msiInstallStateAdvertised = 1
Const msiInstallStateRemoved = 1
Const msiInstallStateAbsent = 2
Const msiInstallStateLocal = 3
Const msiInstallStateSource = 4
Const msiInstallStateDefault = 5
'UI Levels from msi.h
Const msiInstallUILevelNoChange = 0
Const msiInstallUILevelDefault = 1
Const msiInstallUILevelNone = 2
Const msiInstallUILevelBasic = 3
Const msiInstallUILevelReduced = 4
Const msiInstallUILevelFull = 5
Const msiInstallUILevelProgressOnly = 64
' Connect to Windows Installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Dim product
Dim products
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
'Enumerate through all registered products, checking the installstate
Set products = installer.Products : CheckError
For Each product In products
' Only apps that have nothing installed will pass this check.
If (installer.ProductState(product) = msiInstallStateAdvertised) Then
' Wscript.echo installer.ProductInfo( product, "ProductName") & " Is Advertised"
InstallLocal product
Else
' Wscript.echo installer.ProductInfo( product, "ProductName") & " Is Installed"
End If
Next
Wscript.Quit 0
Sub InstallLocal( Product )
' Wscript.echo "Installing " & installer.ProductInfo( product, "ProductName")
'Set Basic UI, wiht no modal dialogs
installer.UILevel = msiInstallUILevelBasic + msiInstallUILevelProgressOnly: CheckError
'Install the product fully (max feature level)
installer.ConfigureProduct product, 65535, msiInstallStateLocal : CheckError
End Sub
Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then
message = message & vbNewLine & errRec.FormatText
' Wscript.Echo message
Exit Sub
End If
End If
' Wscript.Echo message
'Wscript.Quit 2
End Sub
----------------------------------------------------------------------------------------------------
Below is a script that you can use to ensure that applications are completely installed on the local machine.
This script performs a full local installation for all applications that are in the advertised state.
Note that this script will skip any application that is already partially installed.
Therefore, you should make sure this script runs soon after you advertise the application to the user.
You can deploy this script as a Group Policy logon script.
It is recommend that you run this script using Cscript. If you run it using Wscript,
you may want to remove the Wscript.echo statements so that no user intervention is required.
Ensuring Applications Are Fully Installed Locally
' Windows Installer utility to fully install advertised products
' For use with Windows Scripting Host, CScript.exe or WScript.exe
' Copyright (c) 1999, Microsoft Corporation
'
Option Explicit
'Installstates from msi.h
Const msiInstallStateNotUsed = -7
Const msiInstallStateBadConfig = -6
Const msiInstallStateIncomplete = -5
Const msiInstallStateSourceAbsent = -4
Const msiInstallStateInvalidArg = -2
Const msiInstallStateUnknown = -1
Const msiInstallStateBroken = 0
Const msiInstallStateAdvertised = 1
Const msiInstallStateRemoved = 1
Const msiInstallStateAbsent = 2
Const msiInstallStateLocal = 3
Const msiInstallStateSource = 4
Const msiInstallStateDefault = 5
'UI Levels from msi.h
Const msiInstallUILevelNoChange = 0
Const msiInstallUILevelDefault = 1
Const msiInstallUILevelNone = 2
Const msiInstallUILevelBasic = 3
Const msiInstallUILevelReduced = 4
Const msiInstallUILevelFull = 5
Const msiInstallUILevelProgressOnly = 64
' Connect to Windows Installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Dim product
Dim products
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
'Enumerate through all registered products, checking the installstate
Set products = installer.Products : CheckError
For Each product In products
' Only apps that have nothing installed will pass this check.
If (installer.ProductState(product) = msiInstallStateAdvertised) Then
' Wscript.echo installer.ProductInfo( product, "ProductName") & " Is Advertised"
InstallLocal product
Else
' Wscript.echo installer.ProductInfo( product, "ProductName") & " Is Installed"
End If
Next
Wscript.Quit 0
Sub InstallLocal( Product )
' Wscript.echo "Installing " & installer.ProductInfo( product, "ProductName")
'Set Basic UI, wiht no modal dialogs
installer.UILevel = msiInstallUILevelBasic + msiInstallUILevelProgressOnly: CheckError
'Install the product fully (max feature level)
installer.ConfigureProduct product, 65535, msiInstallStateLocal : CheckError
End Sub
Sub CheckError
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then
message = message & vbNewLine & errRec.FormatText
' Wscript.Echo message
Exit Sub
End If
End If
' Wscript.Echo message
'Wscript.Quit 2
End Sub
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.