Solved

Auto install .MSI trouble

Posted on 2008-10-10
10
591 Views
Last Modified: 2013-12-12
Good Afternoon All
I need help lol :(  , we have a Windows 2003 server and Active Directory installed, everything is running good. Today via a GPO i deployed a software abc.msi to install based on user. cant use computer based.
i created a new software installation Package and it is working fine when the user logs on the abc.msi installs.
heres the problem when a user logs in remotely to one of the servers the abc.msi also installs =\  , is there anyway that i can make the gpo check the windows version before the msi installs? or can i edit the .msi to check the os version and deny if it is not windows xp pro?
Thanks all,
0
Comment
Question by:EfrenM
  • 4
  • 3
  • 3
10 Comments
 
LVL 6

Expert Comment

by:bradl3y
ID: 22689123
Having the GPO execute a logon script instead of directly executing the MSI would give you this sort of flexibility.

See this MS KB article regarding detecting the OS of a computer in a logon script.:

http://support.microsoft.com/kb/190899
0
 
LVL 2

Author Comment

by:EfrenM
ID: 22689928
any idea how to make it look for xp only then launch the msi if it is xp?
0
 
LVL 6

Accepted Solution

by:
bradl3y earned 500 total points
ID: 22690266
Sorry, i didn't notice that that script did not detect XP or Server 2003.

I have found this page here that has a more accurate OS detection: http://www.pctools.com/forum/archive/index.php/t-18016.html

Doing this in VBS is much more complicated than using a batch script. In a batch script, you can simply use the "VER" command. I have attached a code snippet that should work in a batch file, i have not tested it, so syntax for my if statement might need to be fixed.
VER | FIND /I "XP"

IF %ERRORLEVEL%==0 msiexec /i \\server\path\to\msi.msi

Open in new window

0
 
LVL 2

Author Closing Comment

by:EfrenM
ID: 31505117
it worked and thank you very much, :)  now time to test it lol, make sure it doesnt auto reinstall everytime i log in lol, well thats a different issue
0
 
LVL 6

Expert Comment

by:bradl3y
ID: 22702103
Also, I know you said that it can't be computer based, but did you mean that in the sense of not being able to supply a list of computers to install on?

What about the option to supply a list of computers NOT to install on? It seems in the permissions of the group policy, you could add the servers to the list and set deny permissions for them. Might be a better solution as you can still have windows manage and track the installs, to make sure it doesn't try to reinstall.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22702261
(for the purposes of knowledge base)

There are two ways:

1. create a transform for abc.msi; you can use ORCA; what you have to do is add row in the table LaunchCondition; the row would have
condition = NOT VersionNT OR VersionNT <> 501
Desription = <the message you want>

The values for different o/s such as 501 are at this page:
http://msdn.microsoft.com/en-us/library/aa370556(VS.85).aspx

or

2. (preferred) create WMI filter and specify it for the group policy. Filter such as
select * from win32_operatingsystem where buildnumber = 2600
would do.

Also, maybe it's not such a good idea when users are allowed to log on on the server. Depends on the circumstances of course.
0
 
LVL 2

Author Comment

by:EfrenM
ID: 22702338
that is a good idea, :)    let me look into it. for now this is what i am experimenting with
This one is at logon, its a batch file
VER | FIND /I "XP"
IF %ERRORLEVEL%==0 \\123.123.12.123\abc.vbs

This is the vbs code checks if product is installed if it is it will popup a window Note " going to remove that feature" if its not it will install it.

Dim installer
Dim bFoundProduct

'Needs to be changed to path of msi
Const PATHTOMSI = "\\123.123.12.123\abc.msi"

Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
Set products = installer.Products

bFoundProduct = False
For Each product In products

If product = "{**********-0B00-******-*********}" Then   <---- Used ORCA to find this out :)
bFoundProduct = True
Exit For
End If

Next

If bFoundProduct Then  <---- Going to remove pop window
MsgBox "Found Product" & " " & product & " " & "- No Action Necessary " Else
installer.InstallProduct PATHTOMSI
End If

set installer = Nothing



0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22703649
You don't need to put up login script if the same can be achieved with regular ways.

Package installed by the GPO directly, not via script, becomes "managed", so it will be uninstalled if you remove it from the policy; it will be installed automatically basing on file extension (see my article for details) , and more.
0
 
LVL 2

Author Comment

by:EfrenM
ID: 22704871
you are a genious lol, it worked like a charm :) , time to start reading into WMI

Thanks a mill Vadimrapp1
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22704960
> time to start reading into WMI

WMI and relative things (ADSI and some others) are quite extensive and ugly areas. Get yourself Scriptomatic or WMI Code Creator (google is your friend), and it will create for you the code you want.
 
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
A list of useful business intelligence software.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now