Application & Packaging Basics (FAQ)
Application & Packaging Basics (FAQ)
All these applications are hard coded to use the Windows Installer service, and may make calls back
to certain locations within the original MSI package.
* What is a MSI?
MSI is “Microsoft Windows Installer”. It is an installation, in the form of a single file. It is actually a
database that contains several tables (80+). Each of these tables contains instructions and set-up
information. In wise there are 120 (87+33) tables.
* Structure of MSI?
o Products (Collection of Features)
o Features (Collection of Components)
o Components (Collection of files and Registries)
* What is Product?
Product is an Application.
* What is Feature?
Features are buckets for Components. Windows Installer configuration commands operate only on
Features (installing, advertising, Uninstalling). Self-healing, install-on-demand and user profile fix-up
operate at the Feature level.
* What is Component?
Components are collections of resources that are always installed or removed as a unit from a user's
system. A resource can be a file, registry key, shortcut, or anything else that may be installed. Every
component is assigned a unique component code GUID.
* How to give Permission for files, folders & Registry keys in MSI?
In the MSI, we can give permissions through Lock Permission table.
* How to give Permission for files, folders & Registry keys through VB Script & what is the
syntax?
We can give permission for files & folders through VB Script by using the CACLS & XCACLS
commands. CACLs should only run on NTFS partitions.
CACLS – Changes Access Control ListS
“Cacls [/T] [/E] [/C] [/G user: perm] [/R user [...]] [/P user: perm [...]] [/D user [...]] “
o /T Changes ACLs of specified files in the current directory and subdirectories
o /E Edit ACL instead of replacing it
o /C Continue (ignore) access denied errors
o /G user : perm where access rights granted can be: R
C F (read, change, full control)
o /R user Revoke specified user's access rights (only valid with /E)
o /P user: perm Replace specified user's access rights. Permission can be: N R C F (none, read,
change, full control)
o /D user Deny specified user access
E.g. “cacls c:\myfile.txt /E /G : F”
In VB Script the syntax as
On Error Resume next
Set Wshell = CreateObject (“Wscript.Shell”)
Wshell.Run “cacls c:\myfile.txt /E /G : F”
* How to disable ARP Details during the Installation through Command line, tell some ARP
properties?
msiexec /i ARPSYSTEMCOMPONENT=1
o ARPAUTHORIZEDCDFPREFIX
o ARPCOMMENTS
o ARPCONTACT
o ARPINSTALLLOCATION
o ARPNOMODIFY
o ARPNOREMOVE
o ARPNOREPAIR
o ARPPRODUCTICON
o ARPREADME
o ARPSIZE
o ARPSYSTEMCOMPONENT
o ARPURLINFOABOUT
o ARPURLUPDATEINFO
* During Installation how to take a back up copy of the Application through Command line?
I never tried check it out.
* What is SFC?
SFC means "System File Checker." It is a command-line utility that scans the operating system's
files to ensure that they are the correct ones (original Microsoft files). But it can be run or scheduled
manually only.
During the process, it will scan all the protected files (.SYS, .DLL, .EXE, .TTF, .FON, and .OCX) to
verify their versions. If the versions are not correct, it will replace the particular files from the back up
folder called DLL Cache folder
* What is Advertisement?
It means that, the Availability of an application to users or others with out actually the full Installation.
There are two types of Advertising
o Assigning
An Application appears (shortcuts, files & registries) to a user or others, when an Application is
“assigned”. When the user tries to open, it is installed upon demand.
o Publishing
No Entry points appear to a user or others, when an Application “published” to the group. It is
activated only if the group Application activates the published Application i.e. Installation on
Demand.
* What are the types of Conditions in the Custom Actions and what is the use?
o Not Installed - During Installation only
o REMOVE - During UnInstallation only
o NOT REMOVE - During both Install & UnInstall
* What is the difference between “Immediate Execute / Deferred Execute” in the Custom
Actions?
o Immediate custom actions, can be sequenced anywhere within any of the sequence tables
Deferred custom actions can only be sequenced between the InstallInitialize and InstallFinalize
actions in execute sequence tables
o Immediate custom actions have access to the Installation database
Deferred custom actions doesn’t have access to the Installation database
o Immediate custom actions can only run in the User Context
Deferred custom actions can run both in the context of the user and elevated using the system
context.
* What is the difference between “Deferred in System Context / Deferred in User Context” in
the Custom Actions?
If the Custom action which installs or modify a file under the INSTALLDIR or Installation should be
run in “Deferred in User Context”
If the Custom action which installs or modify the system file directly should be run in “Deferred
Execution in System Context”
* What are the types of Processing Options in the Custom Actions and what is the use?
o Synchronous
Windows Installer runs the custom action synchronously to the main installation. It waits for the
custom action to complete successfully before continuing the main installation.
o Synchronous, ignore exit code
Windows Installer runs the custom action synchronously to the main installation. It waits for the
custom action to complete before continuing the main installation; the action can be either success
or fail.
o Asynch, wait at end of sequence
Windows Installer runs the custom action simultaneously with the main installation. At the end it
waits for the exit code from the custom action before continuing.
o Asynch, no wait
Windows Installer runs the custom action simultaneously with the main installation. It doesn’t wait for
completion of the custom action and doesn’t check the exit code also.
* What are the types of Scheduling Options in the Custom Actions and what is the use?
o Always Execute
This action execute in all sequences
o Run first time
This action execute only the first time Windows Installer encounters it.
o Run once per process
This action execute only one time either Execute sequence that should not run if the installation is
running in silent mode.
o Run only if UI sequence was run
This action execute only if either Execute sequence is run following User Interface sequence.
* What is IntelliMirror?
IntelliMirror management technologies is a set of powerful features for change and configuration
management. It ensures that users’ data, software, and personal settings are available when they
move from one computer to another, and persist when their computers are connected to the
network.
Microsoft divides IntelliMirror's features into the following four categories:
o User Data Management :. IntelliMirror supports the mirroring of user data to the network and local
copies of selected network data.
o Software Installation and Maintenance : IntelliMirror allows you to centrally manage software
installation, repairs, updates, and removal.
o User Settings Management : IntelliMirror allows you to centrally define computing environment
settings for both users and workstations.
o Remote Installation Services : IntelliMirror allows you to image workstations with the Windows
2000 Professional operating system
* What are the other tools which are used during the testing & solving the Issues in the
Application?
o Picture Taker
o Windows Install Master
o Install rite
o RegMon
o FileMon
o CsDiff
o Icon Extractor & Icon Builder
o RegExtractor
o WiLogUtl
o WiseComReg
o ResourceW2K
* Which drive your Application will Install, C drive has less space and D drive has more
space? Why & how to solve?
It will install “D” drive only due to Windows Installer features.
We can solve by adding “WindowsVolume” entry in the directory table as parent of “TARGETDIR”
* What is a Patch?
Patching is a streamlined process for updating earlier versions of a Windows Installer setup package
i.e. when you update only files that already exist in your installation package. Only the package code
is changed.
* What is Upgrade?
Upgrade is a process of updating the earlier versions of a Windows Installer setup package i.e.
Adding, changing & deleting new Files & Registries. But here product code, product version &
package code should be changed.
In Wise Package Studio, by using “Package Validation” option by selecting the MSI with the default
Cub file or Browse your own Cub file.
In Install Shield, by Build -à Validate-à Default Cub file or Browse your own Cub file.
* What is ICE?
It means “Internal Consistency Evaluation”. ICEs are used to validate installation packages.
* Give some ICE Error number and tell how to solve the ICE Errors?
There are totally 96 ICE Errors and 14 ICEM Errors in the Windows Installer. Some examples are as
follows
o ICE03 - Basic data and foreign key validation
o ICE18 - Validates the KeyPath column of the Component table when it is NULL.
o ICE21 - Validates that all components in the Component table map to a feature in the
FeatureComponents table.
o ICE33 - Checks for entries in the registry table that belong in other tables.
o ICE38 - Validates that components installed under the user's profile use a registry key under
HKCU as their key path.
o ICE64 - Checks that new directories in the user profile are removed in roaming scenarios.
o ICE57 - Validates that individual components do not mix per-machine and per-user data.
o ICE59 - Checks that advertised shortcuts belong to components that are installed by the target
feature of the shortcut.
oICE81
oICE50
* Transforms
The installation process can be manipulated by applying transforms (.mst) to the
installation database. A transform makes changes to elements of the database. For
example, Windows Installer can use a transform file to change the language in the user
interface of an application. The Windows Installer transform files modify the installation
package file at installation time, and can therefore dynamically affect the installation
behavior.
Customization transforms, much like patches, remain cached on the computer. These
transforms are applied to the base package file whenever Windows Installer needs to
perform a configuration
change to the installation package. Transforms are applied at initial installation; they
cannot be applied to an already installed application.
Transforms
.mst file
Secure, unsecure, embeded
defualt -unsecure (can modify)
secure -read only
These .MSI files are basically database files that contain all the information an
application needs in order to install a packaged application. Then once you package
your application you can deploy it using Group Policy by one of two methods:
Publishing an application. You can publish a .MSI package to users only. This
provides the user with an option within Add or Remove Programs in Control Panel that
lets them manually install the application if they want to.
This tool fully complies with Microsoft’s .MSI standards while also extending the
capabilities of .MSI packages without making changes to their native format. The result
is a powerful tool that can be used to deploy legacy, Web-based, and .NET applications
quickly and easily.
Each package (.msi) file contains a relational type database that stores all the
instructions and data required to install (and uninstall) the program across many
installation scenarios. For example, a package file could contain instructions for
installing an application when a prior version of the application is already installed. The
package file could also contain instructions for installing the software on a computer
where that application has never been present.
The Installer is actually a relational database. This database consists of the Installer
package (data1.msi). This package contains information such as the installation
sequence, system dependencies, destination folder paths, setup properties, component
to feature relationship, and overall installation options. This database is never actually
changed or written to. Instead, it uses what is called a Transform file (.mst) to apply
customizations that you desire, to transform the database from its default state. The
Installer doesn't stop there. It also is used for post-installation features such as Detect
and Repair, Add/Remove programs, Run From Network and Install on First Use options.
It is also used to give Elevated Rights (which is not turned ON by default) to an
application on Windows NT so the user doesn't have to be a member of the local NT
Administrator group. Overall, the Installer technology creates a higher level of
customization than has ever been attempted before. Windows Installer technologies are
divided into two parts that work in combination: a client-side installer service
(Msiexec.exe) and a package file (.msi file). Windows Installer uses the information
contained within a package file to install the application.
Because the database is relational, changes made to one table are propagated
automatically throughout the database. This is a very efficient process for introducing
consistent changes into the installation process that simplifies customizing a large
application or group of applications. The Windows Installer database tables reflect the
general layout of the entire group of applications, including:
Available features
Components
Relationships between features and components
Necessary registry settings
The Windows Installer database (.msi file) consists of multiple interrelated tables that
together compose a relational database of the information necessary to install a group
of features. The following table describes the groups of related tables:
Group Description
Core table group Describes the fundamental features and components of the
application& installer package.
File table group Contains the files associated with the installation package.
Registry table group Contains the registry entries.
System table group Tracks the tables and columns of the installation database.
Locator table group Used to search the registry, installer configuration data, directory
tree, or .ini files for the unique signature of a file.
Program installation group Holds properties, bitmaps, shortcuts, and other elements
needed for the application installation.
Installation procedure group Manages the tasks performed during the installation by
standard actions and custom actions.
The ADDLOCAL, ADDSOURCE, and ADVERTISE properties can be used to install only a certain number
of known features. The following command-line script would be used to install the "Sports" and "News"
features of the example.msi package locally on the machine.
The following command-line script would advertise the "Sports" feature and install the "News" feature to
run from source.
Ans: A managed application is an application where the system administrator exerts some level of control
over the installation and maintenance of the product. Managed applications are often used to deploy
software to large numbers of users or machines. Managed applications are a way for system administrators
to allow users to install authorized software in locked-down environments where users generally do not
have the rights to install software.
• Marked as managed by another software and deployment management system. The exact method
depends on the management system used, but generally requires an administrator's action.
An installation package cannot declare itself "managed." Whether or not an application is managed is
controlled by the system administrator.
Note that "managed" is different from "elevated." An elevated application is an application that can run with
system privileges when installing. All managed applications are elevated, but applications can be elevated
without being managed by means of the AlwaysInstallElevated policy. Due to its security implications, this
policy is disabled by default and requires careful consideration before use.
What are the differences between a 'deferred' custom action and an 'immediate' custom action?
Deferred custom actions can only be sequenced between the InstallInitialize and InstallFinalize actions in
execute sequence tables. Immediate custom actions, on the other hand, can be sequenced anywhere
within any of the sequence tables.
Deferred custom actions cannot access the installation database. In fact, deferred custom actions have
very limited access to the installation session because an installation script can be executed outside of the
installation session that created it. Immediate custom actions have access to the installation database and
can read and set installation properties, modify feature and component states, and add temporary columns,
rows, and tables among other things.
While both deferred and immediate custom actions can run in the context of the user initiating the
installation, only deferred custom actions can run elevated using the system context.
Deferred custom actions are not executed immediately. Instead they are scheduled to run later during the
execution script. The execution script isn't processed until the InstallExecute, InstallExecuteAgain, or
InstallFinalize action is run.
When should I use a deferred custom action instead of an immediate custom action?
Deferred custom actions should be used when the custom action must make a change to the system or call
another system service. Additionally, only deferred custom actions can run in an elevated context. If your
custom action requires elevated privileges in order to run, your custom action needs to be marked as
deferred.
Additionally, when making a change to the system by means of a custom action, you should also include
a rollback custom action that can undo the change.
What are the differences between small, minor, and major updates?
A small update is a product update that changes a few files or possibly adds some new content. A minor
update is a product update that makes enough changes to warrant changing the product version for the
product, whereas a major update is a product update with a large number of changes that warrants a
change in the product code. This table summarizes what changes in each update and the possible
distribution vehicles for each.
It's sometimes easier to think of a small update as a "hotfix" or Quick Fix Engineering (QFE) update, a minor
update as a service pack, and a major update as a product upgrade.
Small and minor updates can be considered almost equal in that the only real difference is that a minor
update has a change to the ProductVersion whereas a small update does not. The rules that they follow
and application of the patch are the same. Application of small and minor update patches requires explicit
reinstallations. Major updates are not subject to that limitation and a reinstallation is not required for patch
application. Additionally small and minor update patches are limited in the changes that can be made to the
feature-component structure for the package. Significant changes can be made to the feature-component
structure in the scope of a major update.
Custom actions
Custom actions are actions entirely defined by the user. They can be executable files,
dynamic linked libraries, Visual Basic scripts or JavaScript files. They can be scheduled
at any time during the installation.
Basically, an installation process consists of two sequences: Installation User Interface
Sequence and Installation Execute Sequence. In Advanced Installer, these sequences
are located in the Custom Actions page, under the Project Details tree.
In the User Interface Sequence only immediate custom actions can be used. It
contains a list of Standard Actions starting withBegin and ending
with ExecuteAction. ExecuteAction is the one that triggers the execute sequence. At the
end of the installation process, the installer returns from the execute sequence in the UI
Sequence. It does that in order to execute the actions that may be specified
after ExecuteAction. The installation process ends with the ExitDialog.
The Execute Sequence contains a list of Standard Actions that starts with Begin and
ends with InstallFinalize. It also can contain all types of custom actions: immediate,
deferred, rollback and commit actions. In Advanced Installer, the Execute Sequence
standard actions are organized in three categories:
Before Initialization
Before File Installation
Before Finalization
In the "Before Initialization" category only immediate actions can be used. The
sequence that starts with the InstallInitializestandard action and ends
with InstallFinalize will be gone through twice. The first time the installer scans all the
actions contained by the Execute Sequence and it creates the installation script used for
the actual install. The second time, based on the installation script, the installer
executes all the actions contained by the package only if their conditions were true
when the script was built. For example, it will start/stop services, it will write/modify
registries, create shortcuts and it will install the files on the target machine.
When the installation script execution is done, the installer returns to the User Interface
Sequence in order to display the exit dialog and/or execute any custom actions that may
be placed after the ExecuteAction standard action.
As mentioned above, there are four types of actions:
immediate actions
deferred actions
rollback actions
commit actions
The immediate actions can be used anywhere in the Install UI Sequence and in the
Execute Sequence, but for the second one there is a phase where immediate actions
can no longer be used. That is when the installation script is triggered. The immediate
actions should not modify the target machine since those changes cannot be rolled
back.
The deferred actions, can run only during the installation script execution. The deferred
actions should be the only ones that makes changes on the local machine. This is why
each deferred action must have a rollback action so that the changes it makes can be
undone if the setup fails or is canceled.
The rollback actions are used when the application is installed, but something went
wrong and the installation must be rolled back. While the installation script is executed,
the installer builds a rollback script. After every standard action is executed, the installer
adds a rollback command to the rollback script.
The commit actions are the opposite of the rollback actions. The commit script is
executed after the InstallFinalize standard action when everything ended successfully.
Its purpose is to delete the backup files created by the rollback script.
For each of the deferred, rollback and commit actions you have an additional
option: With no impersonation. This is related to the current user's rights set by the
User Account Control (only for Windows Vista or above) when running the package. A
normal user can run a custom action that requires administrator rights only if the “With
no impersonation” option is set for it.
Path Variables
Define commonly used paths in a central location so that you do not need to change every source file's
path each time you move the project or change the directory structure. In the previous example, if you
keep all of your application's source files in various subfolders under C:\Work\Files, you could create one
variable that points to the Files folder—<MyFiles>.
If you want to include a file that is in C:\Work\Files\Images, you enter <MyFiles>\Images. If you move your
files to D:\Work\Files, you can go to one place, your variable <MyFiles>.
All path variables can be viewed and modified in the Path Variables explorer in the Path Variables view.
You can use path variables in almost any location in InstallShield where you link to source files, such as
in the Dialog Editor, dynamic file links, and the release location. Instead of entering the path variables
yourself, you can have InstallShield recommend them whenever you browse to a path. Path variables are
used during the development of your installation project. These paths do not apply to the target machines
where the application is being installed. Rather, they are used to link to source files for your installation
project. When the project is built, those links are evaluated and the files they point to will be built into the
installation.
There are four types of path variables that you can use. Each type functions somewhat differently from
the others. Regardless of the path variable type you use, the variable name is provided in the same
manner throughout InstallShield.
A Windows Installer installation is run as a sequence of events, called Standard Actions. In between
them, you can schedule your own Custom Actions.
The standard actions used by Advanced Installer can be shown by using the "Show Standard
Action" button on the toolbar of the "Custom Actions" page and they are:
InstallUISequence
Standard Action Description
Begin starts the UI sequence (when the dialogs are shown)
PrepareDlg "PrepareDlg" dialog is shown
AppSearch performs the searches in the Search page
older or newer versions of the package are searched. If an older
FindRelatedProducts version is found, its Product Code is placed in the
"OLDPRODUCTS" property
LaunchConditions evaluates the launch conditions
validates that qualifying products are installed on a system before an
CCPSearch
upgrade is performed
validates that qualifying products are installed on a system before an
RMCCPSearch
upgrade is performed
CostInitialize determines the disk space required by the install process
determines the disk space required by each file in the Files and
FileCost
Folders page
CostFinalize ends the disk space costing and resolves the folders in the project
during an upgrade it reads the feature states in the old version and
MigrateFeatureStates
then sets these feature states in the new version.
WelcomeDlg "WelcomDlg" dialog is shown
ResumeDlg "ResumeDlg" dialog is shown
MaintenanceWelcomeDlg "MaintenanceWelcomeDlg" dialog is shown
PatchWelcomeDlg "PatchWelcomeDlg" dialog is shown
ProgressDlg "ProgressDlg" dialog is shown
starts the Execute sequence (when the actual installation is
ExecuteAction
performed)
InstallExecuteSequence
Before Initialization
Before Finalization
Standard Action Description
InstallFiles installs the files specified in the Files and Folders page
patches files included in the patch. Runs only during a patch
PatchFiles
installation
DuplicateFiles duplicates the files which use File Duplication operations
binds each executable or DLL that must be bound to the DLLs
BindImage imported by it. This is not used by packages created with Advanced
Installer
CreateShortcuts creates the shortcuts specified in the Files and Folders page
RegisterClassInfo manages the registration of COM class information with the system
manages the registration of extension related information with the
RegisterExtensionInfo
system.
RegisterProgIdInfo manages the registration of OLE ProgId information with the system
RegisterMIMEInfo registers MIME-related registry information with the system
WriteRegistryValues creates the registry values specified in the Registry page
WriteINIValues creates INI files or entries specified in the Files and Folders page
creates or modifies the environment variables created in
WriteEnvironmentStrings
the Environment page
RegisterFonts registers fonts marked for registration
InstallODBC installs ODBC drivers, translators and data sources
RegisterTypeLibraries registers type libraries with the system
SelfRegModules registers the modules which use self registration
RegisterComPlus registers COM+ applications
InstallServices installs services specified in the Services page
StartServices starts services which use "Start" control operations in the package
Rollback performs installation rollback in case of an error
Install installs or removes components
Commit removes rollback information
RegisterUser creates users and groups specified in the Users and Groups page
registers the product information with the installer and with
RegisterProduct
Add/Remove Programs. Also, it caches the MSI package
PublishComponents manages components which need to be published
MsiPublishAssemblies publishes the assemblies installed by the package
PublishFeatures writes each feature's state into the system registry
manages the advertisement of the product information with the
PublishProduct system. This action publishes the product if the product is in advertise
mode or if any feature is being installed or reinstalled
InstallIIS manages the elements created in the IIS page
runs a script that contains all operations spooled since the installation
InstallFinalize
started. Also, it marks the end of the Execute sequence
Posted 25th December 2012 by Raju
7
View comments