Re: sms installer- automate installing local printer

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: SMS-Curious guy (SMSCuriousguy_at_discussions.microsoft.com)
Date: 11/22/04

  • Next message: SMS-Curious guy: "Re: sms installer- automate installing local printer"
    Date: Mon, 22 Nov 2004 05:05:04 -0800
    
    

    Hi Terry,

    Hope you had a good weekend- I sent you an e-mail, wanted to see if I could
    try to make some progress today. I have to try to come up with a solution at
    some point today.

    Thank You,

    Steve

    "TerryM" wrote:

    > SMS Installer by Rod Trent is a great reference.
    > You know that's about it.
    > Best way to learn it is read over all sms installer articles on
    > myitforum.com
    > then just do them.
    > But if I may... don't be a dumb repackager. Some guys just think running
    > the repackager tool is enough. Repackaging is almost like being a
    > developer. You need to create 'clean' repackaged apps, you need to
    > understand how applications work, the file system, registry, dll's, ocx's,
    > etc... you need to have a little programming experience, etc..
    > I'm sure some other repackaging tools have a lot more "books" on the topic.
    > I prefer WISE to installshield myself, and I've done hundreds of
    > applications for companies using all three (SMSI, IS, and WISE). There is
    > classes WISE gives that are ok to start.
    >
    > Later
    > T
    >
    > "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com> wrote in message
    > news:6F5459E8-7AB8-4C37-B41F-987B4A209A77@microsoft.com...
    > > cool, and in the meantime can you recommend any good books or any training
    > > methods for getting really good with the installer?
    > >
    > > I already know that the book "sms installer" by rod trent is
    > discontinued...
    > >
    > > "TerryM" wrote:
    > >
    > > > Got it, I'll work on it and send something to you by Monday.
    > > > T
    > > >
    > > > "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com> wrote in
    > message
    > > > news:B5B1375C-DDF8-41AC-84AC-813FF39454AD@microsoft.com...
    > > > > Terry I sent you an e-mail to your hotmail account.
    > > > >
    > > > > "TerryM" wrote:
    > > > >
    > > > > > When you first start SMSI, the GUI interface has the option called
    > > > > > repackage.
    > > > > > Use that.
    > > > > > I have not done a activex control, but I'm fairly certain I could
    > get it
    > > > to
    > > > > > work.
    > > > > > When repackaging though there are several things you will have to
    > clean
    > > > up
    > > > > > afterwards, this takes experience but after doing it for a while
    > you'll
    > > > get
    > > > > > it. These things are usually registry entries, files, etc..
    > > > > > As for no gradient, etc... like I said use the installation
    > properties.
    > > > So
    > > > > > from the drop down menus select edit>installation properties.
    > > > > >
    > > > > > If you want to give it a shot then post here that would be cool. Or
    > you
    > > > can
    > > > > > email me at mattw112 at hotmail.
    > > > > >
    > > > > > T
    > > > > >
    > > > > > "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com> wrote in
    > > > message
    > > > > > news:0420DB2B-03F7-40CA-8129-7E47350D44DD@microsoft.com...
    > > > > > > Terry,
    > > > > > >
    > > > > > > How do I repackage the active x executable so that it does a
    > silent
    > > > > > install
    > > > > > > without any prompting- gradients or the need to reboot?
    > > > > > >
    > > > > > > OR if there is an alternative way to have the script edited
    > manually
    > > > to
    > > > > > > prevent this after using the installation expert - I will try
    > that.
    > > > > > >
    > > > > > >
    > > > > > > "TerryM" wrote:
    > > > > > >
    > > > > > > > Glad it is working,
    > > > > > > > I still would suggest against the set variable sys and the set
    > > > variable
    > > > > > > > sys32..
    > > > > > > >
    > > > > > > > those variables are default SMSI variables that get set to the
    > > > system
    > > > > > and
    > > > > > > > system32 directories on each machine regardless of what the
    > exact
    > > > paths
    > > > > > are.
    > > > > > > >
    > > > > > > > I would use different variable names for yours. I also don't
    > really
    > > > see
    > > > > > the
    > > > > > > > need to add to path.
    > > > > > > >
    > > > > > > > I also still think while your script works you should repackage
    > the
    > > > > > > > install... whenever you have exe's launching scripts, doing
    > stuff...
    > > > it
    > > > > > gets
    > > > > > > > complicated, I have seen times when permissions don't carry
    > over,
    > > > etc...
    > > > > > > >
    > > > > > > > It is much simpler to just repackage the install.
    > > > > > > >
    > > > > > > > So basically ask your self (or use SMSI to tell you) what
    > happens to
    > > > the
    > > > > > > > file system and the registry when a printer is installed?
    > Entries
    > > > are
    > > > > > made
    > > > > > > > in specific places, dlls are registered, files are placed...
    > etc...
    > > > > > just
    > > > > > > > write your script to add the right stuff the right places, then
    > you
    > > > wont
    > > > > > > > even need to launch scripts or cmdlines.
    > > > > > > >
    > > > > > > > As for your question cmd.exe /c executes the command window then
    > > > passes
    > > > > > the
    > > > > > > > stuff after the /c to execute, then it closes. If you had used
    > a /k
    > > > > > instead
    > > > > > > > it does the same thing but keep the cmd window open afterwards.
    > > > > > > >
    > > > > > > > You can append the other exe to the end of this script,... with
    > > > another
    > > > > > cmd.
    > > > > > > > One thing I always do though is give it a little time, maybe a
    > few
    > > > > > seconds
    > > > > > > > at the end before going on to the next thing.
    > > > > > > >
    > > > > > > > So you could keep this script then do another execute at the end
    > or
    > > > I
    > > > > > > > recommend:
    > > > > > > >
    > > > > > > > Repackage the printer install
    > > > > > > > Repackage the active x install
    > > > > > > >
    > > > > > > > Also I would recommend you go in and change the installation
    > > > properties.
    > > > > > > >
    > > > > > > > I don't like logs for simple things like this, so I would turn
    > that
    > > > off,
    > > > > > I
    > > > > > > > would also change to % in script, then get rid of all dialogs,
    > > > > > gradients,
    > > > > > > > etc... then in the script remove the check disk space (unless it
    > is
    > > > > > really a
    > > > > > > > concern).
    > > > > > > >
    > > > > > > > Basically make your script as clean as possible. Try to do
    > > > everything
    > > > > > > > through SMSI commands rather than launching vbs if you can help
    > it.
    > > > > > > >
    > > > > > > > That's about it, Let me know if you have other questions.
    > > > > > > >
    > > > > > > > Terry
    > > > > > > >
    > > > > > > >
    > > > > > > > "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com>
    > wrote in
    > > > > > message
    > > > > > > > news:E619F06D-3383-42C5-AC9C-DA8BA592985D@microsoft.com...
    > > > > > > > > Terry-That worked!! Now just one more question below
    > > > > > > > >
    > > > > > > > > This is the script I used- I just needed to make that
    > cscript.exe
    > > > as
    > > > > > that
    > > > > > > > > is
    > > > > > > > > the name of the file-I am yet to test it on win2k and nt 4.0
    > > > hopefully
    > > > > > it
    > > > > > > > > will work the same.
    > > > > > > > > item: Add Directory to Path
    > > > > > > > >
    > > > > >
    > Directory=C:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > > > > > > > > end
    > > > > > > > > item: Set Variable
    > > > > > > > > Variable=SYS
    > > > > > > > > Value=c:\ups_thermal_2844_643c
    > > > > > > > > end
    > > > > > > > > item: Check Disk Space
    > > > > > > > > Space1=5000
    > > > > > > > > end
    > > > > > > > > item: Set Variable
    > > > > > > > > Variable=CMDLINE
    > > > > > > > > Value=prnmngr.vbs -a -p "UPS2844" -m "ups thermal 2844" -r
    > > > "LPT1:"
    > > > > > > > > end
    > > > > > > > > item: Set Variable
    > > > > > > > > Variable=SYS32
    > > > > > > > >
    > > > Value=c:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > > > > > > > > end
    > > > > > > > > item: Copy Local File
    > > > > > > > > Source=%sys%
    > > > > > > > > Destination=%sys32%
    > > > > > > > > Description English=Configuration files needed for Thermal
    > UPS
    > > > 2844
    > > > > > > > > Local Path=c:\ups_thermal_2844_643c
    > > > > > > > > Flags=0000000101100010
    > > > > > > > > end
    > > > > > > > > item: Execute Program
    > > > > > > > > Pathname=cmd
    > > > > > > > > Command Line=/c cscript.exe %cmdline%
    > > > > > > > > Default Directory=c:\windows\system32
    > > > > > > > > end
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > One more question?- What modifications will I need to make in
    > > > order to
    > > > > > > > > have
    > > > > > > > > the other executable follow (example from the old/wrong script
    > > > from
    > > > > > below
    > > > > > > > > Pathname=c:\ups\active x control
    > > > > > > > >> > > Command Line=ups2442.exe /s
    > > > > > > > > - As it is a pre-made executable-when I run it I notice it
    > > > requires
    > > > > > some
    > > > > > > > > intervention to select NEXT at the prompts- The goal is to
    > > > eliminate
    > > > > > the
    > > > > > > > > need
    > > > > > > > > for user intervention by doing a silent install- I would like
    > to
    > > > > > include
    > > > > > > > > it
    > > > > > > > > in the script that I have created above at the bottom- So that
    > it
    > > > does
    > > > > > > > > both
    > > > > > > > > at the same time) Then I am golden!
    > > > > > > > >
    > > > > > > > > "SMS-Curious guy" wrote:
    > > > > > > > >
    > > > > > > > >> Thanks Terry- Here is the script that I used that seemed to
    > work-
    > > > I
    > > > > > just
    > > > > > > > >> had
    > > > > > > > >> to change that to cscript.exe as opposed to wscript.exe
    > > > > > > > >> item: Add Directory to Path
    > > > > > > > >>
    > > > > > > > >>
    > > > > >
    > Directory=C:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > > > > > > > >> end
    > > > > > > > >> item: Set Variable
    > > > > > > > >> Variable=SYS
    > > > > > > > >> Value=c:\ups_thermal_2844_643c
    > > > > > > > >> end
    > > > > > > > >> item: Check Disk Space
    > > > > > > > >> Space1=5000
    > > > > > > > >> end
    > > > > > > > >> item: Set Variable
    > > > > > > > >> Variable=CMDLINE
    > > > > > > > >> Value=prnmngr.vbs -a -p "UPS2844" -m "ups thermal 2844" -r
    > > > "LPT1:"
    > > > > > > > >> end
    > > > > > > > >> item: Set Variable
    > > > > > > > >> Variable=SYS32
    > > > > > > > >>
    > > > > > Value=c:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > > > > > > > >> end
    > > > > > > > >> item: Copy Local File
    > > > > > > > >> Source=%sys%
    > > > > > > > >> Destination=%sys32%
    > > > > > > > >> Description English=Configuration files needed for Thermal
    > UPS
    > > > 2844
    > > > > > > > >> Local Path=c:\ups_thermal_2844_643c
    > > > > > > > >> Flags=0000000101100010
    > > > > > > > >> end
    > > > > > > > >> item: Execute Program
    > > > > > > > >> Pathname=cmd
    > > > > > > > >> Command Line=/c cscript.exe %cmdline%
    > > > > > > > >> Default Directory=c:\windows\system32
    > > > > > > > >> end
    > > > > > > > >>
    > > > > > > > >>
    > > > > > > > >> What does the /c switch do- call the cmd program? Where can
    > we
    > > > find a
    > > > > > > > >> list
    > > > > > > > >> of switches? One last question can I append the other
    > executable
    > > > > > that I
    > > > > > > > >> want
    > > > > > > > >> to run after this-How would I do that- IF you look at the old
    > > > script
    > > > > > file
    > > > > > > > >> below it is in a local c:\ups\active x control
    > > > > > > > >>
    > > > > > > > >> Pathname=c:\ups\active x control
    > > > > > > > >> > > Command Line=ups2442.exe /s
    > > > > > > > >>
    > > > > > > > >> Hopefully this will work just as well with Windows NT 4.0
    > > > > > > > >>
    > > > > > > > >> Thanks,
    > > > > > > > >>
    > > > > > > > >> Steve
    > > > > > > > >>
    > > > > > > > >> "TerryM" wrote:
    > > > > > > > >>
    > > > > > > > >> > Hi,
    > > > > > > > >> > There are a couple ways to get this to work. Like just
    > > > repackaging
    > > > > > the
    > > > > > > > >> > printer install (like registry entries, files in the right
    > > > places,
    > > > > > > > >> > etc..)
    > > > > > > > >> >
    > > > > > > > >> > However since you are asking about getting the command line
    > to
    > > > work
    > > > > > we
    > > > > > > > >> > can
    > > > > > > > >> > do it that way too.
    > > > > > > > >> >
    > > > > > > > >> > From reading your script you posted there are a few things
    > > > wrong
    > > > > > that
    > > > > > > > >> > will
    > > > > > > > >> > need to be changed.
    > > > > > > > >> >
    > > > > > > > >> > First I wouldn't mess with all the path stuff, and I
    > wouldn't
    > > > try
    > > > > > > > >> > setting a
    > > > > > > > >> > variable sys or sys32 to something other than what they are
    > set
    > > > by
    > > > > > > > >> > default...
    > > > > > > > >> >
    > > > > > > > >> > Basically all you have to do is:
    > > > > > > > >> > a.) "install" (not copy) the vbscript and the printer setup
    > > > files
    > > > > > to
    > > > > > > > >> > the
    > > > > > > > >> > users hard drive.
    > > > > > > > >> > b.) execute program this is where you are making the most
    > > > mistakes.
    > > > > > > > >> > You are
    > > > > > > > >> > not putting anything in for the program to execute, you are
    > > > just
    > > > > > > > >> > putting
    > > > > > > > >> > everything in as a command line. a command line is all the
    > > > stuff
    > > > > > you
    > > > > > > > >> > put
    > > > > > > > >> > after the name of the executable you will be executing.
    > > > > > > > >> >
    > > > > > > > >> > In your case I would do:
    > > > > > > > >> > Install vbscript and files someplace like sys32 (don't need
    > to
    > > > set
    > > > > > this
    > > > > > > > >> > variable as it is by default)
    > > > > > > > >> > Set variable cmdline = %sys32%\prnmngr.vbs -a -p
    > "UPS2844" -m
    > > > "ups
    > > > > > > > >> > thermal
    > > > > > > > >> > 2844" -r "LPT1:"
    > > > > > > > >> > execute program:
    > > > > > > > >> > execute path: cmd.exe
    > > > > > > > >> > command line: /c wscript.exe %cmdline%
    > > > > > > > >> >
    > > > > > > > >> > let me know if you have further questions or issues.
    > > > > > > > >> >
    > > > > > > > >> > Terry
    > > > > > > > >> >
    > > > > > > > >> > "SMS-Curious guy" <SMSCuriousguy@discussions.microsoft.com>
    > > > wrote
    > > > > > in
    > > > > > > > >> > message
    > > > > > > > >> > news:EDFF7645-D95F-48A5-8E4B-4E31CB3AC9E9@microsoft.com...
    > > > > > > > >> > > I need to automate installing a local printer using this
    > dos
    > > > > > based
    > > > > > > > >> > command.
    > > > > > > > >> > >
    > > > > > > > >> > > cscript prnmngr -a -p "UPS2844" -m "ups thermal 2844" -r
    > > > "LPT1:"
    > > > > > > > >> > >
    > > > > > > > >> > > THIS LINE WORKS LIKE A CHARM- SO I KNOW IT IS GOOD- I
    > tested
    > > > it
    > > > > > from
    > > > > > > > >> > > a dos
    > > > > > > > >> > > prompt- the only thing is now I want to automate it so we
    > > > don't
    > > > > > have
    > > > > > > > >> > > to
    > > > > > > > >> > use
    > > > > > > > >> > > an ADD printer wizard and do that manually for 400
    > machines
    > > > or
    > > > > > so.
    > > > > > > > >> > >
    > > > > > > > >> > > The only requirement is that it is run from
    > > > c:\windows\system32
    > > > > > > > >> > > folder.
    > > > > > > > >> > >
    > > > > > > > >> > > Goal- To automate installing a UPS type printer and
    > printer
    > > > > > driver to
    > > > > > > > >> > > evenutually around 400 machines- They are on Win2k, XP
    > and NT
    > > > 4.0
    > > > > > > > >> > platforms.
    > > > > > > > >> > > The printer model is a UPS printer and it is the same
    > model
    > > > for
    > > > > > all.
    > > > > > > > >> > >
    > > > > > > > >> > > I first used the oemsetup.inf file to see where it copied
    > the
    > > > > > files
    > > > > > > > >> > > and
    > > > > > > > >> > then
    > > > > > > > >> > > I had to look inside the oemsetup.inf file to see the
    > name of
    > > > the
    > > > > > > > >> > > driver
    > > > > > > > >> > it
    > > > > > > > >> > > wanted to install.
    > > > > > > > >> > >
    > > > > > > > >> > > Keep in mind I am an sms-installer newbie so I really
    > > > couldn't
    > > > > > find
    > > > > > > > >> > > all of
    > > > > > > > >> > > the functionality I wanted inside of the script editor
    > but
    > > > you
    > > > > > get
    > > > > > > > >> > > the
    > > > > > > > >> > jist-
    > > > > > > > >> > > when I try to run this script the only thing it complains
    > > > about
    > > > > > is
    > > > > > > > >> > > that it
    > > > > > > > >> > > cannot run the external program and the cscript prnmngr
    > line.
    > > > I
    > > > > > > > >> > > stuck the
    > > > > > > > >> > > cmd in front so that it would open dos first it hoping
    > that
    > > > it
    > > > > > would
    > > > > > > > >> > change
    > > > > > > > >> > > things- but no such luck.
    > > > > > > > >> > >
    > > > > > > > >> > > Ok here is the script I made:
    > > > > > > > >> > > item: Add Directory to Path
    > > > > > > > >> > > Directory=c:\windows\system32
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Add Directory to Path
    > > > > > > > >> > >
    > > > > > > > >> > >
    > > > > >
    > Directory=C:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Set Variable
    > > > > > > > >> > > Variable=SYS
    > > > > > > > >> > > Value=c:\ups_thermal_2844_643c
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Set Variable
    > > > > > > > >> > > Variable=SYS32
    > > > > > > > >> > >
    > > > > > > > >> > >
    > > > > > Value=c:\windows\system32\spool\drivers\w32x86\ups_thermal_2844_643c
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Check Disk Space
    > > > > > > > >> > > Space1=5000
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Copy Local File
    > > > > > > > >> > > Source=%sys%
    > > > > > > > >> > > Destination=%sys32%
    > > > > > > > >> > > Description English=Configuration files needed for
    > Thermal
    > > > UPS
    > > > > > 2844
    > > > > > > > >> > > Local Path=c:\ups_thermal_2844_643c
    > > > > > > > >> > > Flags=0000000101100010
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Execute Program
    > > > > > > > >> > > Command Line=cmd cscript prnmngr -a -p "UPS2844" -m
    > "ups
    > > > > > thermal
    > > > > > > > >> > 2844" -r
    > > > > > > > >> > > "LPT1:"
    > > > > > > > >> > > Default Directory=c:\windows\system32
    > > > > > > > >> > > end
    > > > > > > > >> > > item: Execute Program
    > > > > > > > >> > > Pathname=c:\ups\active x control
    > > > > > > > >> > > Command Line=ups2442.exe /s
    > > > > > > > >> > > Default Directory=c:\ups\active x control
    > > > > > > > >> > > Flags=00001010
    > > > > > > > >> > > end
    > > > > > > > >> > >
    > > > > > > > >> > > Ideally I would like to have another executable run after
    > the
    > > > > > first
    > > > > > > > >> > > part
    > > > > > > > >> > of
    > > > > > > > >> > > the command line- That is an active x software installer
    > and
    > > > it
    > > > > > is
    > > > > > > > >> > > already
    > > > > > > > >> > an
    > > > > > > > >> > > executable- so that part should not be a problem. Any
    > > > thoughts-
    > > > > > on
    > > > > > > > >> > > how I
    > > > > > > > >> > > might be able to get this package to work? Also if there
    > was
    > > > a
    > > > > > way
    > > > > > > > >> > > to
    > > > > > > > >> > take a
    > > > > > > > >> > > snapshot of an entire's machine setup with smsinstaller
    > that
    > > > > > would be
    > > > > > > > >> > > good
    > > > > > > > >> > > but I am not sure about those details so if anyone has
    > any
    > > > info
    > > > > > or
    > > > > > > > >> > > can
    > > > > > > > >> > help
    > > > > > > > >> > > me with this project I would appreciate it- there has to
    > be a
    > > > way
    > > > > > to
    > > > > > > > >> > > do
    > > > > > > > >> > this.
    > > > > > > > >> >
    > > > > > > > >> >
    > > > > > > > >> >
    > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >
    > > >
    >
    >
    >


  • Next message: SMS-Curious guy: "Re: sms installer- automate installing local printer"

    Relevant Pages

    • Re: sms installer- automate installing local printer
      ... > Best way to learn it is read over all sms installer articles on ... > the repackager tool is enough. ... > applications for companies using all three (SMSI, IS, and WISE). ... > UPS ...
      (microsoft.public.sms.installer)
    • Re: Wise installer, DFS, Long File Names. Help!
      ... Well I would try posting to a WISE newsgroup. ... "Fix DFS" ... I beleive it has something to do with the installer. ... Tring to run the msi package from the ...
      (microsoft.public.sms.installer)
    • Re: Runtime error 48
      ... or are you using the %SYS% variable in wise to determine the ... correct location for the system folder? ... We have an app ... | installed with Wise Installer. ...
      (microsoft.public.vb.general.discussion)
    • Re: Deploying dotnet assembly with a Win32 application
      ... I think you should be asking this in a Wise forum because this is a question ... Definitive Guide to Windows Installer ... I am also utilizing a web service within my ... > DLL and that DLL itself connects to the web services. ...
      (microsoft.public.dotnet.framework.setup)
    • Re: VS.NET Developers poll: Installshield vs Wise
      ... The MSI installer that comes with VS.NET 2003 is great, ... >wise, I like wise better, but I like MSI the best, especially for .NET ... >> product in deploying .NET apps. ...
      (microsoft.public.dotnet.languages.vb)