[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MSI not register with Add/Remove program

Posted on 2009-04-23
19
Medium Priority
?
1,702 Views
Last Modified: 2013-11-21
I am trying to push out an msi using SCCM.  The status reported successful, but for some reason it's not showing in the add/remove program or creates a shortcut on the desktop if I use SCCM to push it out.  I look at the local drive and it looks like all the files are copied properly and registry enties are added correctly.  

But if I run the same script after I've logon locally with admin rights.  it's showing in the add/remove program.  



0
Comment
Question by:darklord12
  • 6
  • 5
  • 4
  • +1
16 Comments
 
LVL 10

Expert Comment

by:TakedaT
ID: 24221197
You can try to install it using the "runas" command using an administrative account.
0
 

Author Comment

by:darklord12
ID: 24221591
It is pushed silently under administrative account. The program seems to install fine except it does not register with add/remove program or put a shortcut on the desktop when pushing with SCCM.
0
 
LVL 22

Expert Comment

by:Adam Leinss
ID: 24227033
What is your MSIEXEC command line?   Is ALLUSERS=1 apart of it?

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:darklord12
ID: 24227126
I attached the batch file commands.  Like I mention, when I manually run the same script, it registers fine in add/remove and creating all the shortcuts, but it doesn't do all this when it's pushed silently from SCCM.
@ECHO off 
SETLOCAL 
ECHO %THISDIR%
SET THISDIR=%~dps0
 
msiexec.exe /i "%THISDIR%EDIS 4.2.msi" ALLUSERS=1 /m MSISPQJA /qn /l*v C:\medhost.log
 
cscript.exe %THISDIR%DB.vbs //nologo
 
xcopy %THISDIR%registerall.bat C:\medhost\system /i /y
 
xcopy %THISDIR%registerallsilent.bat c:\medhost\system /i /y
 
C:\medhost\system\registerAllSilent.bat 
 
exit 0

Open in new window

0
 
LVL 22

Expert Comment

by:Adam Leinss
ID: 24227500
Sounds like it isn't even firing.
What does C:\windows\system32\ccm\execmgr.log show?
Is this running from a DP or from the local cache on the client?
This command line should be this I think:
msiexec.exe /i "EDIS42.msi" ALLUSERS=1 /m MSISPQJA /qn /l*v C:\medhost.log
Take out the spaces, extra periods and that %THISDIR% variable
 
0
 

Author Comment

by:darklord12
ID: 24227588
it download from DP and run from local cache on client.  I think every line get executed to the end because I look under program files and see that the program is installed.  I checked the registry and confirm that the line that execute the .vbs file also run because correct registry entries were created.  The problem with it is that it does not create shortcuts on desktop or register itself in add/remove program.
0
 
LVL 29

Expert Comment

by:matrixnz
ID: 24237451
Have a look under "C:\WINDOWS\System32\config\systemprofile\Desktop" is the shortcut their, since SCCM uses the Local System Account to install, that's usually where the shortcuts endup?  Also try and use ALLUSERS=2 and let us know what the results are, for some reason, I have more success with AllUsers=2 then AllUsers=1.

Cheers
0
 

Author Comment

by:darklord12
ID: 24237959
Yes I tried both ALLUSERS=1 and ALLUSERS=2 with same result.  I haven't looked under C:\WINDOWS\System32\config\systemprofile\Desktop though, I will look at it when I get to work tomorrow.  

When I specify the program to run per-user unattended under user's credential while the user log in  then the install seems to regsiter with control panel and create shortcuts fine.  However, when I specify the program to run with administrative right per system unattended while whether or not the user log in then I get the problem as orginally described.  it's strange.  Perhaps something wrong with the msi.  I already asked the vendor to take a look again at the msi. Hopefully it's something they can fix.
0
 
LVL 29

Expert Comment

by:matrixnz
ID: 24238529
Fortunately it doesn't happen often but it's a pain when it does, basically the issue stems from the System Account used to install the application.  I've come across two applications like this, the installer appeared to be trying to access information within the profile, from memory it was the Shell Folders > Personal (My Documents) which System doesn't have.  Anyway for me I used runas using AutoIT to get around this, fortunately we have a domain account with limited access to the domain, but a member of the local administrators group on all our systems, so it was fairly easy work around.

Cheers
0
 

Author Comment

by:darklord12
ID: 24240317
Are you suggesting I should use something like: runas /user:localmachine\user msiexec.exe /i "EDIS42.msi" ALLUSERS=1 /m MSISPQJA /qn /l*v C:\medhost.log at the command line where user is a member of local admin group and a member of domain?

For the program properties setting in config manager console, do I need to change it to run with user credential while user is logged on? Thanks.

0
 
LVL 29

Accepted Solution

by:
matrixnz earned 2000 total points
ID: 24243459
That is correct, only reason being, the user needs to have access to the SMS Distribution Point, if however you're going to have it executing locally i.e. downloaded than you wouldn't need domain access.  The user will still need to be a member of the local administrators group.

However the problem is you need to also specify a password which is why I tend to use AutoIT, see the script below, it hasn't been tested but should work all the same.

1. Download and Install AutoIT also recommend downloading and installing the AutoIT Script Editor http://www.autoitscript.com/autoit3/downloads.shtml 
2. Copy and Paste the Script below into Scite (AutoIT Script Editor)
3. Edit the Script with your local username and password and save
4. Click Tools - Compile Script
5. You will find an executable has been created in the same folder as the script, double click the file to run.

Within the Program Properties just let it run as the user, i.e. not the system account

That's it.

I use AutoIT rather than Batch Files because there are just so many functions available to make scripting easy, it also does away with the old dos window + you can create Guis very easily, making the process much easier for the end user.

Hope that helps.

Cheers


#NoTrayIcon
 
; Gets SystemDrive Variable example C: and appends the directory medhost\system\
$BAT_MEDHOST = EnvGet('SYSTEMDRIVE') & '\medhost\system'
 
;Below is the commandline to runas a particular user, if you are going to use a domain user, just substitute @computername with 'DomainName'
$EXE_MSIEXEC = RunAs('UserName', @ComputerName, 'Password', 0, @SystemDir & 'MsiExec.exe /i "' & @ScriptDir & '\EDIS 4.2.msi" ALLUSERS=1 /m MSISPQJA /qn /l*v ' & @TempDir & '\medhost.log', '', @SW_HIDE)
 
;Waits for the Msiexec Process to finish before continuing
;I use this rather than RunAsWait because there can be multiple instances of MsiExec Running
_FNC_RUNWAIT($EXE_MSIEXEC)
 
;Below is the commandline to install the VB Script
$EXE_VBSEXEC = RunAs('UserName', @ComputerName, 'Password', 0, @SystemDir & '\CSCRIPT.EXE "' & @ScriptDir & '\DB.vbs"', '', @SW_HIDE)
 
;Same as Above
_FNC_RUNWAIT($EXE_VBSEXEC)
 
;Checks to see if the files exist on the local system and than copies the files if not
;It will also create the folder structure if the structure isn't already in place
If FileExists($BAT_MEDHOST & '\registerall.bat') <> 1 Then FileCopy(@ScriptDir & '\registerall.bat', $BAT_MEDHOST & '\registerall.bat', 8)
If FileExists($BAT_MEDHOST & '\registerallsilent.bat') <> 1 Then FileCopy(@ScriptDir & '\registerallsilent.bat', $BAT_MEDHOST & '\registerallsilent.bat', 8)
 
;Simple Runwait command similar to Dos Start /WAIT I assumed you didn't need Admin credentials, otherwise just use RunAs Commandline as above
RunWait($BAT_MEDHOST & '\registerallsilent.bat', '', @SW_HIDE)
 
;Function to wait until the process is completed
Func _FNC_RUNWAIT($TMP_EXTEXEC)
	While ProcessExists($TMP_EXTEXEC)
		Sleep(100)
	WEnd
EndFunc

Open in new window

0
 

Author Comment

by:darklord12
ID: 24252689
Thank you for the detail response.  The firewall at my work place is currently block me from downloading AutoIT editor.  I have to put in a request for this site to be opened or have to download it later today when I get home.

Can I just use runas command and use an domain account that is a member of the local admin group?  The problem I have with runas is that after I hit enter, I have to enter the password for the account - is there a way to automate this process?  I think the echo command probably can do this, but don't recall the syntax exactly.
0
 
LVL 29

Expert Comment

by:matrixnz
ID: 24253141
Unfortunately you can't use a password with the standard RunAs, which is why I use AutoIT, there are other programs that will do it for example see http://www.moernaut.com/default.aspx?item=lsrunase

It would be better to use something like this or AutoIT imho as batch files are always going to be written in clear text and would appear in the SCCM Exec Manager Logs.

Cheers
0
 
LVL 29

Expert Comment

by:matrixnz
ID: 24460622
I've posted the work around for this, as I mentioned some MSI's cannot be run as System which is why the error is occurring.
0
 
LVL 22

Expert Comment

by:Adam Leinss
ID: 24461560
Not amazing at all.  Logging was suggested:

aleinss Date: 04/24/09 11:46 AM
msiexec.exe /i "EDIS42.msi" ALLUSERS=1 /m MSISPQJA /qn /l*v C:\medhost.log

but not necessary.  There really isn't any difference between SCCM firing an installation and you walking up to a workstation to fire it.  Since the installation was working when installed manually, we knew he was using the right parameters.  However, there is a big difference on the SCCM side if you choose "Run with Administrative Rights", because it uses the local system account which doesn't have rights to network resources.  

One example of a program that doesn't run under SYSTEM is RealPlayer 11, because it tries to access the Internet and many companies use a proxy device to control Internet access.

Therefore, matrixnz likely has the right answer and should be awarded the points.
0
 
LVL 22

Expert Comment

by:Adam Leinss
ID: 24463421
Award points to matrixnz
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Make the most of your online learning experience.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Starting up a Project

834 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