Jump to content

Recommended Posts

Posted (edited)

Making MSIs is time consuming, never straightforward and as versions of software change, you have to make new MSIs.

I think @sted has the right idea.

To make the batch file simpler, and to reduce potential delays to login times, I setup a software install account that I use to log into any freshly installed PC to install the software. Give it full admin rights, and use a simplified batch file without any error checking as you know you are only using it on vanilla PCs. I use BGINFO to display useful info and to set a particularly garish wallpaper so I know I'm logged in using the software install account - don't want to accidentally leave a PC logged in with admin rights! Maybe a bit 'old school' these days but it works for me and I am an old stick in the mud!

 

You can put allsorts in the batch file, below are some examples from my software.bat file.

 

REM Copy Paint onto the local machine.

xcopy r:\paint\mspaint.* c:\windows\system32\ /y

 

REM Activate Smartnotebook software

"C:\Program Files\Common Files\SMART Technologies\SMART Product Update\activationwizard.exe" --suid clash_notebook --m=4 --a --pk

 

REM Install probotix

cls

echo.

echo About to install probotix.

echo.

echo.

echo.

echo please connect and switch on the probotix car now. Once connected and drivers have been installed

pause

R:\CommonPrograms\Probotix\setup.exe

 

REM Paint.NET

"\\svr\packages$\Paint.NET\PaintDotNet.x86.msi"

 

REM UnityWebPlayer

\\svr\software\UnityWebPlayer.exe /allusers

 

REM Start Flashplayer download/install

rem start iexplore Adobe - Install Adobe Flash Player

Edited by hallb15
Posted
....but I can't write scripts :(

 

if you get a training buget i can recommend a good powershell course that can helkp you but i suspect it being based in york might be a killer.

 

tbh bat scripting isnt that hard just get a vm/non important pc and try it theres lots of help here or on google most of it comes down to knowing a few commands (if all your doing is installing/checking software a lot of it comes down to if exist some file then goto something

 

for instance this is just one i ripped off a server

 

 @echo OFF
REM --- Check for an existing installation of Video Lan Client
if exist "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" goto _End
REM --- Deploy to Windows 2000/XP/2003
"\\server1\packages$\ms msi\access07 viewer\AccessRuntime.exe" /quiet
REM --- End of the script
:_End

@echo off just tells the script not to display results and can be ignored

anything with a rem is there for people to read not the computer so is a note

if exist "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" goto _End says if i can find msaccess.exe its installed go to _end (ie my work here is done)

rem line

"\\server1\packages$\ms msi\access07 viewer\AccessRuntime.exe" /quiet specific to the software and is just trial and error/googlefu in this case run AccessRuntime.exe with /quiet so no user input is needed

:_end in this case the end of the script but technically its a procedure called _end the :before it tells ou this is the actual procedure not a call to it so in other code i might say something like if this pc is x86 go to x86 so it runs x86 specific bits or in this more complex script it checks if software is installed by querying reg keys and working out if the pc is x86/x64 and runs files as appropriate

 

rem @echo OFF
rem works bets as SHUTDOWN script as it requires config that happens at reboot
rem check windows version for 7
VER | findstr /l "6.1." > nul
IF %ERRORLEVEL% EQU 0 goto install
goto exit

:install
REM Check to see if .Net Framework 4.5 is installed
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.2"
IF %errorlevel%==1 GOTO INSTALLNET
IF %errorlevel%==0 GOTO checkps4
:INSTALLNET
"\\domain.local\dfs\packages\ms msi\dotnet452\NDP452-KB2901907-x86-x64-AllOS-ENU.exe" /norestart /q
:checkps4


rem check to see of powershell 4 is installed
REG QUERY "HKLM\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" /f 4.0
IF %errorlevel%==1 GOTO INSTALLWMF
IF %errorlevel%==0 GOTO EXIT
:INSTALLWMF
echo Detecting OS processor type 
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT
echo 32-bit OS
wusa.exe "\\domain.local\dfs\packages\ms msi\powershell4\Windows6.1-KB2819745-x86-MultiPkg.msu" /quiet /norestart
goto exit

:64bit
echo x64 os

wusa.exe "\\domain.local\dfs\packages\ms msi\powershell4\Windows6.1-KB2819745-x64-MultiPkg.msu" /quiet /norestart

:EXIT
rem shutdown /r
Exit

 

between those 2 scripts you can pretty much just change the folder paths etc and deploy a large chunk of non msi software

Posted

See attached,

its a little rough and ready but should give you the gist.

 

making MSI's can be a pain and more so if they need updating alot, bearing in mind some apps are quite happy to be run from a share on the server for example so a simple shortcut pointing to the app often is all you need.

 

let me know what you think @witch @speckytecky

advanced_inst_guide.docx

  • Thanks 2
Posted (edited)

@SHimmer45 Thanks very much

@sted Everything is easy if you know how to do it!

I've never had any training in anything and sadly I am someone who really struggles with reading technical things in books - I am much better at hearing it :(

Edited by witch
Posted (edited)
@SHimmer45 Thanks very much

@sted Everything is easy if you know how to do it!

I've never had any training in anything and sadly I am someone who really struggles with reading technical things in books - I am much better at hearing it :(

 

I'm not good at reading either - I just wade in and see what happens when I tweak bits and pieces until I find what works. I totally agree, anything is easy when you know how, but batch files can be as complicated or simple as you make them. You could try making one that installs just one piece of software. Play around with it on a test machine - putting the 'pause' command as the last line will make the command prompt window stay open so you can see any errors that may have appeared.

 

Maybe if you could list the programs you want to install, someone on here will have some MSIs or know the best way to install them. I'd be more than happy to help you write your batch file...

Edited by witch
Posted
I'm not good at reading either - I just wade in and see what happens when I tweak bits and pieces until I find what works. I totally agree, anything is easy when you know how, but batch files can be as complicated or simple as you make them. You could try making one that installs just one piece of software. Play around with it on a test machine - putting the 'pause' command as the last line will make the command prompt window stay open so you can see any errors that may have appeared.

 

Maybe if you could list the programs you want to install, someone on here will have some MSIs or know the best way to install them. I'd be more than happy to help you write your batch file...

 

This is getting embarrassing. I have no idea how to even start a batch file.

You have to have a base level of knowledge and I..just..don't :(

Posted (edited)

Don't be emabarrased. That's what edugeek is for, right?

 

A batch file is just a text file with the .BAT extension.

Its really just a list of commands that you would type in at the command prompt (or in MS DOS for those that are from the Pre-Windows era like me!)

 

The simplest way to create one in Win 7 is to right click on the desktop, click New then Text Document. Rename the file to something like software.bat - Windows will ask you if you are sure you want to change the file extension, just click Yes.

Then right click that new file and select edit.

Now the fun starts.

 

I know you don't like reading but this website is a good, simple resource for batch file help - and many other topics

Batch File Help

 

We can do this! If you are considering creating MSIs then you are more than capable of creating batch files.

 

PM me if you like.

Edited by hallb15
Typo
  • Thanks 1
Posted (edited)

It's not that I don't like reading - far from it, I read all the time, even walking the dog - but I find when reading something technical I need to be able to check what I have understood and maybe ask for clarification quite often which you can't do from a page!

I have several scripts that I understand in general terms but it is all the little bits I don't really get. I am not quite as hopeless as I am appearing today - I am having a rotten time of late - but due to the way I have learned I can only get the gist of things, I don't know the detail :(

 

I have just followed the msi help doc kindly put up by @SHimmer45 - -I muddled through and got to the end..but my msi wants someone to click "next" which isn't any use to me and it also occurred to me that I don't know how to set it up so that it doesn't reinstall if the software is already there

NB: I have put it in a gpo and run it - it just stops so I am presuming that is why.

I could NEVER wade in and tweak things. Just can't. Not made that way.

Edited by witch
Posted

It sounds like the MSI needs to be told to run in 'silent' mode. This is a fairly generic command that works on the majority of MSI files.

 

To test yours out, go to Start --> Run

 

Type in:

 

msiexec /I path to msi /q

 

Eg, msiexec /I "c:\my apps\my program.msi" /q

 

If this works as intended, you would use this command in a batch file as @hallb15 has described

Posted (edited)
It sounds like the MSI needs to be told to run in 'silent' mode. This is a fairly generic command that works on the majority of MSI files.

 

To test yours out, go to Start --> Run

 

Type in:

 

msiexec /I path to msi /q

 

Eg, msiexec /I "c:\my apps\my program.msi" /q

 

If this works as intended, you would use this command in a batch file as @hallb15 has described

But I don't want to use a batch file, I want to install it via GPO as all my msi's are done this way. There must be a way - some of the msis I have must have some sort of silent install instruction?

Edited by witch
Posted

In that case, you shouldn't need to worry about the 'Next' box coming up. When you deploy software via a GPO, as long as you set it as an 'assigned' piece of software then it should do all the silent commands for you.

 

My bit above would be just for testing purposes to make sure it does actually install correctly on a machine.

Posted
Ok, to clarify, you're adding it to a GPO as an MSI under Software Installation and it still prompts for user interaction?

Well, it stops - and I can see that it starts to instal it so I am presuming that is why. Nothing in event viewer that I can see and the msi runs fine when not in a gpo other than that first "click to install" page

Posted
When you say it stops, what do you mean? Does msiexec stay open in task manager at all? And there's definitely nothing in the Application log? Its very odd as msiexec is quite noisy when it does anything.
Posted

Out of interest, where is your MSI located? If its a network share, is there sufficient permissions on the share for the system to be able to reach the installer?

 

The way I have things here, I created a folder inside the NETLOGON share (permissions issues then not a problem) and tell GPO's to get their installers from:

 

\\domainname\netlogon\software\program.msi

Posted
most msi's even ones that gpo deploy fine will show next etc boxes if run but will work if deployed through gpo quite happily as they effectively deploy with /qn appended to the command line. To test this just open admin command prompt on a pc and try installing the package with msiexec /I path to software /qn (or personally I prefer qb as it dosent allow input but shows a percentage bar so you can see its working)
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...