Automating driver installation on Windows XP - winapi

I have a sound card driver and I need to automate the installation of it on windows. Is there any way to achieve this.

This is a question for Server Fault, but many driver install files offer switches that can be used for a silent or unattended install. You could run the program with the /? switch or contact the device manufacturer for more information. Once you have that information, you could schedule the command using Scheduled Tasks in XP or the registry (RunOnce key).

Actually you probably want to read the driver installation section on msdn. (For I am not sure what you mean by "automating".)

This question should be asked at server fault.
Anyways, I assume you mean to want it to be installed with your OS.
One way is to slipstream the driver into your Windows OS Installer.
A good guide is:
Using Nlite (Simple) :
http://www.nliteos.com/
or
(Advanced)
http://unattended.msfn.org/unattended.xp
If not please specify the situation.

nLite (http://www.nliteos.com/) should have the solution you need.

Related

How to install driver/.inf file during setup with NSIS?

currently I use a NSIS script which installs a device driver/.inf file this way:
File /r "mydriver.inf"
File /r "mydriver.cat"
nsExec::ExecToStack 'pnputil -i "mydriver.inf"'
This works smoothly with Windows 7 - when the user first connects the device, it is already known to the system and the correct driver is applied automatically.
Now I found that no longer works with Windows 8.x, here the user has to go to device manager, click the new device and point it to storage place of .inf/.cab files manually.
So how can this be done better? How can I let Windows 8 know about this driver so that it uses them automatically once the device is connected?
Thanks!
Have you tried pnputil -a -i "c:\full\path\to\myinf.inf"?
If you did not write this driver then you should ask the people that wrote it.
This is not really a NSIS specific question so you might want to reformat the question a little bit so the NT driver gurus can find it. You might also have more luck if you try the MSDN driver dev. forums and/or the OSR list...

What kind of software shows one what files are beeing installed on the HDD during .exe or .msi install process?

I remember having seen a windows software that shows one (in realtime) what files are beeing installed/extracted on the HDD and what keys are written in the registry during an .exe or .msi install process, but I don't remember what kind of software it was.
Was is maybe some kind of sandbox or a sysinternals tool?
Can anyone help me?
I think the sysinternals suite has utilities for recording changes from filesystem and registry (regmon and filemon).
Its a sysinternals tool that I use, called Process Monitor. http://technet.microsoft.com/en-us/sysinternals/bb896645
As I found out there are tools developed exactly for this purpose. Namely:
SpyMe Tools
Total Uninstall
What Changed
Sysinternals tools are great too, but you have to use good filters if possible otherwise, you'll have an extreme information overflow.

Observing how an MSI installer is installing an application

I am trying to find out how a driver is being installed on the system from a MSI setup package. I am currently using a program called InstEd to try and get an idea of what its doing:
http://i.imgur.com/b9USo.jpg
I am interested in "MsiProcessDrivers" and "MsiInstallDrivers".
Can anyone reccomend how I can see how the drivers are being installed?
The MS Sysinternals suite has some tools for monitoring registry and disk operations. Just run them prior to running the installation, and note the actions that are performed by the installer.
Sysinternal's Process Monitor will show file system and registry changes being made: filter by msiexec processes.
Warning: for a non-trivial install this is likely to be a lot of operation.
The two custom actions you reference (MsiProcessDrivers, and MsiInstallDrivers) are part of the DIFx Driver Installation Framework as used with Windows Installer.

Registering Windows Programs to Installed Programs List

As you know, Windows has a "Add/Remove Programs" system in the Control Panel.
Let's say I am preparing an installer and I want to register my program to list of installed programs and want it to be uninstallable from "Add/Remove Programs"?
Which protocols should I use. Any tutorials or docs about registering programs to that list?
I am coding with python and I can use WMI (Windows Management Instrument) or Win32 API. IMHO, it is done with Registry keys but I am not sure with it.
I also want to execute an uninstaller upon the Uninstallation to remove installed files. Any related docs or tutorials are highly appreciated. Thanks.
As stated on IRC:
"Windows keeps its uninstall information in the registry"
Its in HLLM\Software\Microsoft\Windows\CurrentVersion\uninstall\ keys.
You need a few things from the Win32 API, but I belive there's a fair amount of Python support for the win32 API.
Basically, a key in ...\Uninstall\ with a unique name (like "MyApp") with a few special values stashed in there. Add/Remove programs looks through there.
Its pretty self-explanatory.
If you are developing for Windows platform I think using Windows Installer from Microsoft won't be a problem.
You can check documentation of Windows Installer from Microsoft.com Windows Installer Page
Inno Setup is open source so perhaps you can get some ideas from that.

What directory should my installer install an app on Vista?

I've nearly completed developing a game for Windows and I'm curious where I should have the installer install it. I know it used to be in "Program Files" but has that changed under Vista?
I know that World of Warcraft now installs under Users/Public/Games... what is the Microsoft-recommended location for games?
In Vista, the recommended directory is still %PROGRAMFILES%.
Note that in Windows 7, Microsoft has enabled the creation of true per-user installations, including support for per-user Program Files. This is a feature of Windows Installer 5.0, and you can read more about it here:
http://msdn.microsoft.com/en-us/library/dd408068(VS.85).aspx
You should use the Environment variables.
Namely %PROGRAMFILES% for you.
Just read the question a little more thoroughly. From my experience of Vista, most of the gubbins still install to %PROGRAMFILES%. Perhaps the /users/public... path is somewhere where things can install (and update) without having to get admin perms all the time. (A complete guess)
Looks like you should use SHGetKnownFolderPath to ask for the location of the FOLDERID_Games KNOWNFOLDERID.
EDIT: Nope, doesn't look like that is right. This thread has a discussion of FOLDERID_Games and notes that it is a virtual directory. This knowledgebase article discusses the Windows Vista Games Explorer. And this article has some more Vista specific information.
Sorry - this has turned into a non-answer but maybe the links will help you find the answer.
The recommended directory is still Program Files, as everyone has said. However, if you want a per-user install, you could install it in the AppData folder. I know Google Chrome does this to allow installation without being an administrator, and also for user-specific installation.

Resources