1月19日
Programmatic Remote MSI Installation in Windows
Two months before, I received a requisition to automate the installation of a set of MSIs for our products on any remote machine. The strategy of the this automated installation has some intelligent alignments (thanks to my team managers) of product features with related MSIs. The GUI part of the tool is used to configure such things. The command line tool just take a configuration and install a set of features on the given machines.
The basic functionality of the command line tool is to install a set of MSIs on one or more remote machines. For this, we planned to used WMI. Before that I briefly explain the environment.
Development Platform: .NET 2.0
Server Platform: Windows Server 2003 Ent
Decided that all the machines are connected in a same network domain. We are successfully implemented the command line tool (here after I called CMDTL). After the first test, we met a problem while installing a MSI on remote machine. The story is really complicated and also by the help of fraser_foo, I was moved some more steps for the solution, but...?! (okay). At the time of development, I saw a thread in Microsoft forum initiated by fraser_foo. You can visit that thread by just googling "Remote MSI Installation" or visit that thread. You can see a long replies.
Okay, Let me explain the story.
Let three machines A, B and C in a domain called "XDOMAIN". And let consider the user "ADMIN_USER" has all administrator credential on all machines. The domain is working in ADS (Active Directory service) enivronment.
A: Here, I'm running the CMDTL.
B: On this, the MSI packages are installed and shared with all set of permission to ADMIN_USER. Let take a sample MSI called SAMSETUP.msi.
C: The target machine on which I need to install SAMSETUP.msi.
All the three machines are running in Win2003 Server with WMI Installer Provider.
Note:
By default, WMI Windows Installer Provider is not installed in Win2003. You have to install by
select Start > Control Panel > Add or Remove Programs.
In Add or Remove Programs window, press Add or Remove Windows Components button.
In Windows Components Wizard window, select Management and Monitoring Tools from the Components list. Press Details.. button.
In Management and Monitoring Tools window, select WMI Windows Installer Provider in the Subcomponents of Management and Monitoring Tools list.
Press OK.
See the below scenario:
Scenario 1:
Running CMDTL in A. SAMSETUP.msi file in B. Target machine is A itself.
Result --> PASS
Scenario 2:
Running CMDTL in A. SAMSETUP.msi file in C. Target machine is C.
Result --> PASS
Scenario 3:
Running CMDTL in A. SAMSETUP.msi file in B. Target machine is C.
Result --> FAIL
But we really need the third scenario only.
Okay, In this article, I'm going to explain the below:
- WMI
- WMI Installer
- WMI in .NET
- Problem with WMI Installer
- WSH
- Remoting Scripting
C...U.. I'll meet on series 2.