Pages

Sunday 11 March 2012

MSI Properties



There are several notable properties that will be used many, many times. Most of them control
how a package is installed:
• TRANSFORMS—Specifies a list of transforms to apply to an MSI during package
installation.
• ADDLOCAL—Lists features to install on the local computer.
• ALLUSERS—Controls whether installations are performed for all users of the computer
or just the user running the installation.
• ROOTDRIVE—Controls which drive Windows Installer installs packages on—by
default packages are installed on the local drive that has the most free space.
• INSTALLDIR—Controls the exact directory to which a package must be installed.
• REBOOT—Controls whether the package requests a reboot after installation.

Entry Points and Advertisements


Ever wonder how Windows Installer knows to get involved with repairing or installing an
application? Entry points allow Windows Installer to proxy the startup of an application and
perform application management tasks before the user is allowed to access the application. In
other words, when you double-click the icon for a Windows Installer packaged software
application, it does not actually attempt to start the application directly. The icon is a special icon
that asks Windows Installer to find the software application and start it. This is when Windows
Installer can use the MSI repository information, the installed application resources (files,
registry keys, and so on), and the original package file to perform the magic of self-healing and
install on demand.




An entry point turns into an advertised interface when any Feature that its Component belongs to
is advertised or installed on a target computer system. When a Windows Installer package is
advertised, advertised interfaces make it appear as though the application is installed and ready
to use. When a Windows Installer package is installed, advertised interfaces trigger Windows
Installer for self-healing and user profile fix-up checking. An entry point/advertised interface can
be:


• A shortcut (special Windows Installer shortcut)
• A document extension (association)
• A MIME type (Internet document types)
• A Class ID (CLSID)—Programmatic identities used for sharing software within and
between various applications

I can change My Document folder,My Favorites,Start Menu?


Use Registry entry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Then change path you want to change and Log off or Restart machine to view changes

How to retrieve Uninstall Information of various applications?


1. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Application_Name
      

2. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Application_Name

     (From here you can get information regarding the installed applications)

Enable Windows Installer Logging

To enable Windows Installer logging, use following registry


HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
Reg_SZ: Logging
Value: voicewarmup 

What is Active Setup


Active setup is a process that runs automatically when a user logs in.
 
Registry keys at 
 
HKLM\Software\Microsoft\Active Setup\Installed Components\%APPNAME% 
 
and 
 
HKCU\Software\Microsoft\Active Setup\Installed Components\%APPNAME% 
 
are compared, and if the HKCU registry entries don't exist, or the version number of HKCU is less than HKLM, then the specified application is executed for the current user. 
 
If your application requires installation of components such as files or registry keys on a per-user basis, but your application has no advertised entry points or other triggers to initiate the installation process, then Active Setup is the solution. To implement Active Setup, 
populate the following registry key with two ( REG_SZ ) values: 
 
KEY: 
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\%APPNAME% - where %APPNAME% is an arbitrary string which can be the application name, or its product code GUID if using an MSI. (As long as it is unique on that workstation!)
 
VALUE1: StubPath=<full local path>\YourActiveSetup.exe 
 
VALUE2: Version=1 
 
When each new user logs on, the operating system compares Active Setup keys between HKLM and HKCU, and runs the nominated executable if the HKCU entry is missing or the version in HKCU is less than HKLM.  So if you ever need to update the ActiveSetup executable, just install
a new version, and increment the Version registry key (VALUE2 above) in HKLM. Next time the user logs on, the active setup will run again for that user. 
 
To force a repair using the existing MSI where a separate Active Setup EXE is not required, you can do it this way: 
Create the following key structure under HKEY_LOCAL_MACHINE hive:
HKEY_LOCAL_MACHINE\Software\Microsoft\ActiveSetup\InstalledComponents\[ProductCode]
Under this registry key, create a <new string value> such as:
 
"StubPath"="msiexec /fous {ProductCode} /qb"

Run, Run Once Registry Keys


Run keys cause programs to automatically run each time that a user logs on. The Windows registry includes the following four Run keys:


HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
 


Each of these keys has a series of values. The values allow multiple entries to exist without overwriting one another. The data value for a value is a command line.


There are some special considerations for the third and fourth keys in the list, the RunOnce keys:
1.     By default, Run keys are ignored when the computer starts in Safe mode. Under the RunOnce keys, you can prefix a value name with an asterisk (*) to force the associated program to run even in Safe mode.
2.     You can prefix a RunOnce value name with an exclamation point (!) to defer deletion of the value until after the command runs.
3.     Without the exclamation point prefix, a RunOnce value is deleted before the command runs. As a result, if a RunOnce operation does not run properly, the associated program is not asked to run the next time you start the computer.

If more than one program is registered under any particular key, the order in which those programs are run is indeterminate. A program run from any of these keys should not write to the key during its execution. Doing so will interfere with the execution of other programs registered under the key. Furthermore, applications should use the RunOnce keys only for transient conditions (such as to complete application setup); an application must not continually re-create entries under RunOnce. Doing so will interfere with Windows Setup.