Tuesday, July 1, 2008

[Code Project]Wrapping the Windows Installer 2.0 API

See Link Wrapping the Windows Installer 2.0 API

Friday, June 27, 2008

Installation Problems

See Link : http://makemsi-manual.dennisbareis.com/installproblems.htm

Windows Installer Error Codes

From Link : http://msdn.microsoft.com/en-us/library/aa368542.aspx

error codes ERROR_SUCCESS, ERROR_SUCCESS_REBOOT_INITIATED, and ERROR_SUCCESS_REBOOT_REQUIRED are indicative of success. If ERROR_SUCCESS_REBOOT_REQUIRED is returned, the installation completed successfully but a reboot is required to complete the installation operation.

See Windows Installer Error Messages for errors returned by the Windows Installer.

Error code Value Description
ERROR_SUCCESS 0 The action completed successfully.
ERROR_INVALID_DATA 13 The data is invalid.
ERROR_INVALID_PARAMETER 87 One of the parameters was invalid.
ERROR_CALL_NOT_IMPLEMENTED 120 This value is returned when a custom action attempts to call a function that cannot be called from custom actions. The function returns the value ERROR_CALL_NOT_IMPLEMENTED. Available beginning with Windows Installer version 3.0.
ERROR_APPHELP_BLOCK 1259 If Windows Installer determines a product may be incompatible with the current operating system, it displays a dialog box informing the user and asking whether to try to install anyway. This error code is returned if the user chooses not to try the installation.
ERROR_INSTALL_SERVICE_FAILURE 1601 The Windows Installer service could not be accessed. Contact your support personnel to verify that the Windows Installer service is properly registered.
ERROR_INSTALL_USEREXIT 1602 The user cancels installation.
ERROR_INSTALL_FAILURE 1603 A fatal error occurred during installation.
ERROR_INSTALL_SUSPEND 1604 Installation suspended, incomplete.
ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed.
ERROR_UNKNOWN_FEATURE 1606 The feature identifier is not registered.
ERROR_UNKNOWN_COMPONENT 1607 The component identifier is not registered.
ERROR_UNKNOWN_PROPERTY 1608 This is an unknown property.
ERROR_INVALID_HANDLE_STATE 1609 The handle is in an invalid state.
ERROR_BAD_CONFIGURATION 1610 The configuration data for this product is corrupt. Contact your support personnel.
ERROR_INDEX_ABSENT 1611 The component qualifier not present.
ERROR_INSTALL_SOURCE_ABSENT 1612 The installation source for this product is not available. Verify that the source exists and that you can access it.
ERROR_INSTALL_PACKAGE_VERSION 1613 This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
ERROR_PRODUCT_UNINSTALLED 1614 The product is uninstalled.
ERROR_BAD_QUERY_SYNTAX 1615 The SQL query syntax is invalid or unsupported.
ERROR_INVALID_FIELD 1616 The record field does not exist.
ERROR_INSTALL_ALREADY_RUNNING 1618 Another installation is already in progress. Complete that installation before proceeding with this install.

For information about the mutex, see _MSIExecute Mutex.

ERROR_INSTALL_PACKAGE_OPEN_FAILED 1619 This installation package could not be opened. Verify that the package exists and is accessible, or contact the application vendor to verify that this is a valid Windows Installer package.
ERROR_INSTALL_PACKAGE_INVALID 1620 This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.
ERROR_INSTALL_UI_FAILURE 1621 There was an error starting the Windows Installer service user interface. Contact your support personnel.
ERROR_INSTALL_LOG_FAILURE 1622 There was an error opening installation log file. Verify that the specified log file location exists and is writable.
ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623 This language of this installation package is not supported by your system.
ERROR_INSTALL_TRANSFORM_FAILURE 1624 There was an error applying transforms. Verify that the specified transform paths are valid.
ERROR_INSTALL_PACKAGE_REJECTED 1625 This installation is forbidden by system policy. Contact your system administrator.
ERROR_FUNCTION_NOT_CALLED 1626 The function could not be executed.
ERROR_FUNCTION_FAILED 1627 The function failed during execution.
ERROR_INVALID_TABLE 1628 An invalid or unknown table was specified.
ERROR_DATATYPE_MISMATCH 1629 The data supplied is the wrong type.
ERROR_UNSUPPORTED_TYPE 1630 Data of this type is not supported.
ERROR_CREATE_FAILED 1631 The Windows Installer service failed to start. Contact your support personnel.
ERROR_INSTALL_TEMP_UNWRITABLE 1632 The Temp folder is either full or inaccessible. Verify that the Temp folder exists and that you can write to it.
ERROR_INSTALL_PLATFORM_UNSUPPORTED 1633 This installation package is not supported on this platform. Contact your application vendor.
ERROR_INSTALL_NOTUSED 1634 Component is not used on this machine.
ERROR_PATCH_PACKAGE_OPEN_FAILED 1635 This patch package could not be opened. Verify that the patch package exists and is accessible, or contact the application vendor to verify that this is a valid Windows Installer patch package.
ERROR_PATCH_PACKAGE_INVALID 1636 This patch package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer patch package.
ERROR_PATCH_PACKAGE_UNSUPPORTED 1637 This patch package cannot be processed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
ERROR_PRODUCT_VERSION 1638 Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs in Control Panel.
ERROR_INVALID_COMMAND_LINE 1639 Invalid command line argument. Consult the Windows Installer SDK for detailed command-line help.
ERROR_INSTALL_REMOTE_DISALLOWED 1640 Installation from a Terminal Server client session is not permitted for the current user.
ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success.
ERROR_PATCH_TARGET_NOT_FOUND 1642 The installer cannot install the upgrade patch because the program being upgraded may be missing or the upgrade patch updates a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.
ERROR_PATCH_PACKAGE_REJECTED 1643 The patch package is not permitted by system policy.
ERROR_INSTALL_TRANSFORM_REJECTED 1644 One or more customizations are not permitted by system policy.
ERROR_INSTALL_REMOTE_PROHIBITED 1645 Windows Installer does not permit installation from a Remote Desktop Connection.
ERROR_PATCH_REMOVAL_UNSUPPORTED 1646 The patch package is not a removable patch package. Available beginning with Windows Installer version 3.0.
ERROR_UNKNOWN_PATCH 1647 The patch is not applied to this product. Available beginning with Windows Installer version 3.0.
ERROR_PATCH_NO_SEQUENCE 1648 No valid sequence could be found for the set of patches. Available beginning with Windows Installer version 3.0.
ERROR_PATCH_REMOVAL_DISALLOWED 1649 Patch removal was disallowed by policy. Available beginning with Windows Installer version 3.0.
ERROR_INVALID_PATCH_XML 1650 The XML patch data is invalid. Available beginning with Windows Installer version 3.0.
ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT 1651 Administrative user failed to apply patch for a per-user managed or a per-machine application that is in advertise state. Available beginning with Windows Installer version 3.0.
ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success. This does not include installs where the ForceReboot action is run.


Sunday, June 15, 2008

Change the full path of the product installation

Change the full path of the product installation
Note: I've searched the various links to get information at one place. I've not checked the contents for validation. So I'm not responsible for any issue found related to the contents specified in the blog. Please use contents at own risk.

The api directory function of Msi - MsiSetTargetPath can be used to set the target path of the product to be installed. The complete syntax declaration of the api is given below:
MsiSetTargetPath:
Declare Function MsiSetTargetPath lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFolder As String, ByVal szFolderPath As String) As Long
This function Sets the full target path for a directory listed in the Directory table.

Parameters

hInstall [in] Handle to the installation provided to a DLL custom action or obtained
through MsiOpenPackage, MsiOpenPackageEx, or
MsiOpenProduct.

szFolder [in] Specifies the folder identifier. This is a primary key in the Directory table.

szFolderPath [in] Specifies the full path for the folder, ending in a directory separator.

Return Value

The MsiSetTargetPath function returns the following values:

ERROR_DIRECTORY The directory specified was not found in the Directory table.

ERROR_INVALID_HANDLE An invalid or inactive handle was supplied.

ERROR_INVALID_PARAMETER An invalid parameter was passed to the function.

ERROR_SUCCESS The function succeeded.
Directory Table

The Directory table specifies the directory layout for the product. Each row of the table indicates a directory both at the source and the target.

The Directory table has the following columns.

Column Type Key Nullable
Directory Identifier Y N
Directory_Parent Identifier N Y
DefaultDir DefaultDir N N

Before using MsiSetTargetPath function, check the product state to ensure that nothing of the product was installed yet.

ProductState Property

The installer sets the ProductState property to the installation state for the product at initialization. This property is set to one of the following INSTALLSTATE data types returned by MsiQueryProductState.


use the function MsiQueryProductState for this purpose.

MsiQueryProductState Function
Declare Function MsiQueryProductState lib "MSI" (ByVal szProduct As String) As INSTALLSTATE

Parameters

szProduct [in] Specifies the product code that identifies the product to be queried.


Return Value

Value Meaning

INSTALLSTATE_ABSENT

The product is installed for a different user.

INSTALLSTATE_ADVERTISED

The product is advertised but not installed.

INSTALLSTATE_DEFAULT

The product is installed for the current user.

INSTALLSTATE_INVALIDARG

An invalid parameter was passed to the function.

INSTALLSTATE_UNKNOWN

The product is neither advertised or installed.



MsiOpenProduct
The MsiOpenProduct function opens a product for use with the functions that access the product database. The MsiCloseHandle function must be called with the handle when the handle is no longer needed.

Declare Function MsiOpenProduct lib "MSI" (ByVal szProduct As String, ByRef hProduct As MSIHANDLE) As Long

Parameters

szProduct [in] Specifies the product code of the product to be opened.

hProduct [out] Pointer to a variable that receives the product handle.

Return Value

Value Meaning

ERROR_BAD_CONFIGURATION

The configuration information is corrupt.

ERROR_INSTALL_FAILURE

The product could not be opened.

ERROR_INSTALL_SOURCE_ABSENT

The source was unavailable.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_SUCCESS

The function completed successfully.

ERROR_UNKNOWN_PRODUCT

The product code was unrecognized.


MsiCloseHandle
Closes a database, view, or record handle.
Declare Function MsiCloseHandle lib "MSI" (ByRef hAny As MSIHANDLE) As Long

hAny [in] Specifies any open installation handle.

Return Value

Value Meaning

ERROR_INVALID_HANDLE

An invalid handle was passed to the function.

ERROR_SUCCESS

The function succeeded.


Related Studies:
1. Managed Applications
2. Microsoft Installer: MSI
3. msiblogger

Friday, June 13, 2008

MsiExec.exe Command-Line Parameters

Note: I've searched the various links to get information at one place. I've not checked the help for validation. So I'm not responsible for any issue found related to the contents specified in the blog. Please use contents at own risk.

The table below provides a detailed description of MsiExec.exe command line parameters.

Parameter Description
/i or Use this format to install the product Othello:

msiexec /i "C:\\Profiles\\Personal\MySetups\Othello\Trial Version\Release\DiskImages\Disk1\Othello Beta.msi"

Product Code refers to the GUID that is automatically generated in the Product Code property of your product's project view.
/f [p|o|e|d|c|a|u|m|s|v] or Installing with the /f option will repair or reinstall missing or corrupted files.

For example, to force a reinstall of all files, use the following syntax:

msiexec /fa "C:\\Profiles\\Personal\MySetups\Othello\Trial Version\Release\DiskImages\Disk1\Othello Beta.msi"

in conjunction with the following flags:
  • p reinstalls a file if it is missing
  • o reinstalls a file if it is missing or if an older version of the file is present on the user's system
  • e reinstalls a file if it is missing or if an equivalent or older version of the file is present on the user's system
  • c reinstalls a file if it is missing or if the stored checksum of the installed file does not match the new file's value
  • a forces a reinstall of all files
  • u or m rewrite all required user registry entries
  • s overwrites any existing shortcuts
  • v runs your application from the source and re-caches the local installation package
/a The /a option allows users with administrator privileges to install a product onto the network.
/x or The /x option uninstalls a product.
/j [u|m]
/j [u|m] /t
/j [u|m] /g
/j
Building with the /j option advertises the components of your application on the end user's computer
  • u advertises components only to the current user
  • m advertises components to all users of the computer
  • g specifies language ID
  • t applies a transform to your advertised product
Transforms allow the synchronization of applications across different languages. For example, if you upgrade the English version of your product, you could apply a transform to automatically upgrade the French version of your product.
/L [i|w|e|a|r|u|c|m|p|v|+] Building with the /L option specifies the path to the log file—these flags indicate which information to record in the log file:
  • i logs status messages
  • w logs non-fatal warning messages
  • e logs any error messages
  • a logs the commencement of action sequences
  • r logs action-specific records
  • u logs user requests
  • c logs initial user interface parameters
  • m logs out-of-memory messages
  • p logs terminal settings
  • v logs the verbose output setting
  • + appends to an existing file
  • * is a wildcard character that allows you to log all information (excluding the verbose output setting)
/p Building with the /p option applies a patch to an installed setup package. To patch an installed administrative image, combine this option with /a as shown:

/p /a
/q [n|b|r|f] The /q option is used to set the user interface level in conjunction with the following flags:
  • q or qn creates no user interface
  • qb creates a basic user interface
The user interface settings below display a modal dialog box at the end of installation:
  • qr displays a reduced user interface
  • qf displays a full user interface
  • qn+ displays no user interface
  • qb+ displays a basic user interface
/? or /h Either command displays Windows Installer copyright information
/y This command calls the DllRegisterServer entry-point function of the DLL or OCX file specified in .
/z This command calls the DllUnregisterServer entry-point function of the DLL or OCX file specified in .
TRANSFORMS Use the TRANSFORMS command line parameter to specify any transforms that you would like applied to your base package. Your transform command line call might look something like this:

msiexec /i "C:\\Profiles\\Personal\MySetups\Your Project Name\Trial Version\My Release-1\DiskImages\Disk1\ProductName.msi" TRANSFORMS="New Transform 1.mst"

You can separate multiple transforms with a semicolon. Because of this, it is recommended that you do not use semicolons in the name of your transform, as the Windows Installer service will interpret those incorrectly.
Properties All public properties can be set or modified from the command line. Public properties are distinguished from private properties by the fact that they are in all capital letters. For example, COMPANYNAME is a public property.

To set a property from the command line, use the following syntax: PROPERTY=VALUE. If you wanted to change the value of COMPANYNAME, you would enter:

msiexec /i "C:\\Profiles\\Personal\MySetups\Your Project Name\Trial Version\My Release-1\DiskImages\Disk1\ProductName.msi" COMPANYNAME="InstallShield"


Windows Installer API Functions

Note: I've searched the various links to get information at one place. I've not checked the help for validation. So I'm not responsible for any issue found related to the contents specified in the blog. Please use contents at own risk.

Most Windows Installer API functions take a handle to the currently running database as an argument. For an InstallScript custom action, the database handle is the HWND argument passed to the custom action. In an event-handler function, you can use the global variable ISMSI_HANDLE, which stores the handle to the running .msi database.


MsiApplyPatch MsiGetLanguage MsiRecordSetInteger
MsiCloseHandle MsiGetLastErrorRecord MsiRecordSetStream
MsiCreateTransformSummaryInfo MsiGetMode MsiRecordSetString
MsiDatabaseApplyTransform MsiGetProperty MsiSequence
MsiDatabaseExport MsiGetSourcePath MsiSetComponentState
MsiDatabaseGenerateTransform MsiGetSummaryInformation MsiSetFeatureAttributes
MsiDatabaseGetPrimaryKeys MsiGetTargetPath MsiSetFeatureState
MsiDatabaseImport MsiInstallProduct MsiSetInstallLevel
MsiDatabaseIsTablePersistent MsiOpenDatabase MsiSetMode
MsiDatabaseMerge MsiOpenPackage MsiSetProperty
MsiDatabaseOpenView MsiPreviewBillboard MsiSetTargetPath
MsiDoAction MsiPreviewDialog MsiSummaryInfoGetProperty
MsiEnumComponentCosts MsiProcessMessage MsiSummaryInfoSetProperty
MsiEvaluateCondition MsiRecordClearData MsiVerifyDiskSpace
MsiFormatRecord MsiRecordDataSize MsiViewClose
MsiGetActiveDatabase MsiRecordGetFieldCount MsiViewExecute
MsiGetComponentState MsiRecordGetInteger MsiViewFetch
MsiGetFeatureCost MsiRecordGetString MsiViewGetColumnInfo
MsiGetFeatureState MsiRecordIsNull MsiViewGetError
MsiGetFeatureValidStates MsiRecordReadStream








Declaration about the functions is :

Declare Function MsiApplyPatch lib "MSI" (ByVal szPatchPackage As String, ByVal szInstallPackage As String, ByVal eInstallType As Struct_MembersOf_INSTALLTYPE, ByVal szCommandLine As String) As Long
Declare Function MsiCloseAllHandles lib "MSI" () As Long
Declare Function MsiCloseHandle lib "MSI" (ByRef hAny As MSIHANDLE) As Long
Declare Function MsiCollectUserInfo lib "MSI" (ByVal szProduct As String) As Long
Declare Function MsiConfigureFeature lib "MSI" (ByVal szProduct As String, ByVal szFeature As String, ByVal eInstallState As Struct_MembersOf_INSTALLSTATE) As Long
Declare Function MsiConfigureProduct lib "MSI" (ByVal szProduct As String, ByVal iInstallLevel As Long, ByVal eInstallState As Struct_MembersOf_INSTALLSTATE) As Long
Declare Function MsiConfigureProductEx lib "MSI" (ByVal szProduct As String, ByVal iInstallLevel As Long, ByVal eInstallState As Struct_MembersOf_INSTALLSTATE, ByVal szCommandLine As String) As Long
Declare Sub MsiCreateRecord lib "MSI" (ByVal cParams As Long)
Declare Function MsiCreateTransformSummaryInfo lib "MSI" (ByRef hDatabase As MSIHANDLE, ByRef hDatabaseReference As MSIHANDLE, ByVal szTransformFile As String, ByVal iErrorConditions As Long, ByVal iValidation As Long) As Long
Declare Function MsiDatabaseApplyTransform lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szTransformFile As String, ByVal iErrorConditions As Long) As Long
Declare Function MsiDatabaseCommit lib "MSI" (ByRef hDatabase As MSIHANDLE) As Long
Declare Function MsiDatabaseExport lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szTableName As String, ByVal szFolderPath As String, ByVal szFileName As String) As Long
Declare Function MsiDatabaseGenerateTransform lib "MSI" (ByRef hDatabase As MSIHANDLE, ByRef hDatabaseReference As MSIHANDLE, ByVal szTransformFile As String, ByVal iReserved1 As Long, ByVal iReserved2 As Long) As Long
Declare Function MsiDatabaseGetPrimaryKeys lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szTableName As String, ByRef phRecord As MSIHANDLE) As Long
Declare Function MsiDatabaseImport lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szFolderPath As String, ByVal szFileName As String) As Long
Declare Function MsiDatabaseIsTablePersistent lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szTableName As String) As MSICONDITION
Declare Function MsiDatabaseMerge lib "MSI" (ByRef hDatabase As MSIHANDLE, ByRef hDatabaseMerge As MSIHANDLE, ByVal szTableName As String) As Long
Declare Function MsiDatabaseOpenView lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szQuery As String, ByRef phView As MSIHANDLE) As Long
Declare Function MsiDoAction lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szAction As String) As Long
Declare Function MsiEnableLog lib "MSI" (ByVal dwLogMode As Long, ByVal szLogFile As String, ByVal dwLogAttributes As Long) As Long
Declare Function MsiEnableUIPreview lib "MSI" (ByRef hDatabase As MSIHANDLE, ByRef phPreview As MSIHANDLE) As Long
Declare Function MsiEnumClients lib "MSI" (ByVal szComponent As String, ByVal iProductIndex As Long, ByVal lpProductBuf As String) As Long
Declare Function MsiEnumComponentQualifiers lib "MSI" (ByVal szComponent As String, ByVal iIndex As Long, ByVal lpQualifierBuf As String, ByRef pcchQualifierBuf As Long, ByVal lpApplicationDataBuf As String, ByRef pcchApplicationDataBuf As Long) As Long
Declare Function MsiEnumComponents lib "MSI" (ByVal iComponentIndex As Long, ByVal lpComponentBuf As String) As Long
Declare Function MsiEnumFeatures lib "MSI" (ByVal szProduct As String, ByVal iFeatureIndex As Long, ByVal lpFeatureBuf As String, ByVal lpParentBuf As String) As Long
Declare Function MsiEnumPatches lib "MSI" (ByVal szProduct As String, ByVal iPatchIndex As Long, ByVal lpPatchBuf As String, ByVal lpTransformsBuf As String, ByRef pcchTransformsBuf As Long) As Long
Declare Function MsiEnumProducts lib "MSI" (ByVal iProductIndex As Long, ByVal lpProductBuf As String) As Long
Declare Function MsiEnumRelatedProducts lib "MSI" (ByVal lpUpgradeCode As String, ByVal dwReserved As Long, ByVal iProductIndex As Long, ByVal lpProductBuf As String) As Long
Declare Function MsiEvaluateCondition lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szCondition As String) As MSICONDITION
Declare Function MsiFormatRecord lib "MSI" (ByRef hInstall As MSIHANDLE, ByRef hRecord As MSIHANDLE, ByVal szResultBuf As String, ByRef pcchResultBuf As Long) As Long
Declare Sub MsiGetActiveDatabase lib "MSI" (ByRef hInstall As MSIHANDLE)
Declare Function MsiGetComponentPath lib "MSI" (ByVal szProduct As String, ByVal szComponent As String, ByVal lpPathBuf As String, ByRef pcchBuf As Long) As INSTALLSTATE
Declare Function MsiGetComponentState lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szComponent As String, ByRef piInstalled As INSTALLSTATE, ByRef piAction As INSTALLSTATE) As Long
Declare Function MsiGetDatabaseState lib "MSI" (ByRef hDatabase As MSIHANDLE) As MSIDBSTATE
Declare Function MsiGetFeatureCost lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFeature As String, ByVal iCostTree As Struct_MembersOf_MSICOSTTREE, ByRef iState As INSTALLSTATE, ByRef piCost As Long) As Long
Declare Function MsiGetFeatureInfo lib "MSI" (ByRef hProduct As MSIHANDLE, ByVal szFeature As String, ByRef lpAttributes As Long, ByVal lpTitleBuf As String, ByRef pcchTitleBuf As Long, ByVal lpHelpBuf As String, ByRef pcchHelpBuf As Long) As Long
Declare Function MsiGetFeatureState lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFeature As String, ByRef piInstalled As INSTALLSTATE, ByRef piAction As INSTALLSTATE) As Long
Declare Function MsiGetFeatureUsage lib "MSI" (ByVal szProduct As String, ByVal szFeature As String, ByRef pdwUseCount As Long, ByRef pwDateUsed As Integer) As Long
Declare Function MsiGetFeatureValidStates lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFeature As String, ByRef dwInstallStates As Long) As Long
Declare Function MsiGetFileVersion lib "MSI" (ByVal szFilePath As String, ByVal lpVersionBuf As String, ByRef pcchVersionBuf As Long, ByVal lpLangBuf As String, ByRef pcchLangBuf As Long) As Long
Declare Function MsiGetLanguage lib "MSI" (ByRef hInstall As MSIHANDLE) As Long
Declare Function MsiGetMode lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal eRunMode As Struct_MembersOf_MSIRUNMODE) As Long
Declare Function MsiGetPatchInfo lib "MSI" (ByVal szPatch As String, ByVal szAttribute As String, ByVal lpValueBuf As String, ByRef pcchValueBuf As Long) As Long
Declare Function MsiGetProductCode lib "MSI" (ByVal szComponent As String, ByVal lpBuf39 As String) As Long
Declare Function MsiGetProductInfo lib "MSI" (ByVal szProduct As String, ByVal szAttribute As String, ByVal lpValueBuf As String, ByRef pcchValueBuf As Long) As Long
Declare Function MsiGetProductProperty lib "MSI" (ByRef hProduct As MSIHANDLE, ByVal szProperty As String, ByVal lpValueBuf As String, ByRef pcchValueBuf As Long) As Long
Declare Function MsiGetProperty lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szName As String, ByVal szValueBuf As String, ByRef pcchValueBuf As Long) As Long
Declare Function MsiGetShortcutTarget lib "MSI" (ByVal szShortcutPath As String, ByVal szProductCode As String, ByVal szFeatureId As String, ByVal szComponentCode As String) As Long
Declare Function MsiGetSourcePath lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFolder As String, ByVal szPathBuf As String, ByRef pcchPathBuf As Long) As Long
Declare Function MsiGetSummaryInformation lib "MSI" (ByRef hDatabase As MSIHANDLE, ByVal szDatabasePath As String, ByVal uiUpdateCount As Long, ByRef phSummaryInfo As MSIHANDLE) As Long
Declare Function MsiGetTargetPath lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFolder As String, ByVal szPathBuf As String, ByRef pcchPathBuf As Long) As Long
Declare Function MsiGetUserInfo lib "MSI" (ByVal szProduct As String, ByVal lpUserNameBuf As String, ByRef pcchUserNameBuf As Long, ByVal lpOrgNameBuf As String, ByRef pcchOrgNameBuf As Long, ByVal lpSerialBuf As String, ByRef pcchSerialBuf As Long) As USERINFOSTATE
Declare Function MsiInstallMissingComponent lib "MSI" (ByVal szProduct As String, ByVal szComponent As String, ByVal eInstallState As Struct_MembersOf_INSTALLSTATE) As Long
Declare Function MsiInstallMissingFile lib "MSI" (ByVal szProduct As String, ByVal szFile As String) As Long
Declare Function MsiInstallProduct lib "MSI" (ByVal szPackagePath As String, ByVal szCommandLine As String) As Long
Declare Function MsiLocateComponent lib "MSI" (ByVal szComponent As String, ByVal lpPathBuf As String, ByRef pcchBuf As Long) As INSTALLSTATE
Declare Function MsiOpenDatabase lib "MSI" (ByVal szDatabasePath As String, ByVal szPersist As String, ByRef phDatabase As MSIHANDLE) As Long
Declare Function MsiOpenPackage lib "MSI" (ByVal szPackagePath As String, ByRef hProduct As MSIHANDLE) As Long
Declare Function MsiOpenProduct lib "MSI" (ByVal szProduct As String, ByRef hProduct As MSIHANDLE) As Long
Declare Function MsiPreviewBillboard lib "MSI" (ByRef hPreview As MSIHANDLE, ByVal szControlName As String, ByVal szBillboard As String) As Long
Declare Function MsiPreviewDialog lib "MSI" (ByRef hPreview As MSIHANDLE, ByVal szDialogName As String) As Long
Declare Function MsiProcessMessage lib "MSI" (ByRef hInstall As MSIHANDLE, ByRef eMessageType As INSTALLMESSAGE, ByRef hRecord As MSIHANDLE) As Long
Declare Function MsiProvideComponent lib "MSI" (ByVal szProduct As String, ByVal szFeature As String, ByVal szComponent As String, ByVal dwInstallMode As Long, ByVal lpPathBuf As String, ByRef pcchPathBuf As Long) As Long
Declare Function MsiProvideQualifiedComponent lib "MSI" (ByVal szCategory As String, ByVal szQualifier As String, ByVal dwInstallMode As Long, ByVal lpPathBuf As String, ByRef pcchPathBuf As Long) As Long
Declare Function MsiProvideQualifiedComponentEx lib "MSI" (ByVal szCategory As String, ByVal szQualifier As String, ByVal dwInstallMode As Long, ByVal szProduct As String, ByVal dwUnused1 As Long, ByVal dwUnused2 As Long, ByVal lpPathBuf As String, ByRef pcchPathBuf As Long) As Long
Declare Function MsiQueryFeatureState lib "MSI" (ByVal szProduct As String, ByVal szFeature As String) As INSTALLSTATE
Declare Function MsiQueryProductState lib "MSI" (ByVal szProduct As String) As INSTALLSTATE
Declare Function MsiRecordClearData lib "MSI" (ByRef hRecord As MSIHANDLE) As Long
Declare Function MsiRecordDataSize lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long) As Long
Declare Function MsiRecordGetFieldCount lib "MSI" (ByRef hRecord As MSIHANDLE) As Long
Declare Function MsiRecordGetInteger lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long) As Long
Declare Function MsiRecordGetString lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long, ByVal szValueBuf As String, ByRef pcchValueBuf As Long) As Long
Declare Function MsiRecordIsNull lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long) As Long
Declare Function MsiRecordReadStream lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long, ByVal szDataBuf As String, ByRef pcbDataBuf As Long) As Long
Declare Function MsiRecordSetInteger lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long, ByVal iValue As Long) As Long
Declare Function MsiRecordSetStream lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long, ByVal szFilePath As String) As Long
Declare Function MsiRecordSetString lib "MSI" (ByRef hRecord As MSIHANDLE, ByVal iField As Long, ByVal szValue As String) As Long
Declare Function MsiReinstallFeature lib "MSI" (ByVal szProduct As String, ByVal szFeature As String, ByVal dwReinstallMode As Long) As Long
Declare Function MsiReinstallProduct lib "MSI" (ByVal szProduct As String, ByVal szReinstallMode As Long) As Long
Declare Function MsiSequence lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szTable As String, ByVal iSequenceMode As Long) As Long
Declare Function MsiSetComponentState lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szComponent As String, ByRef iState As INSTALLSTATE) As Long
Declare Sub MsiSetExternalUI lib "MSI" (ByRef puiHandler As INSTALLUI_HANDLERA, ByVal dwMessageFilter As Long, pvContext As Any)
Declare Function MsiSetFeatureAttributes lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFeature As String, ByVal dwAttributes As Long) As Long
Declare Function MsiSetFeatureState lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFeature As String, ByRef iState As INSTALLSTATE) As Long
Declare Function MsiSetInstallLevel lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal iInstallLevel As Long) As Long
Declare Function MsiSetInternalUI lib "MSI" (ByVal dwUILevel As Struct_MembersOf_INSTALLUILEVEL, ByRef phWnd As Long) As INSTALLUILEVEL
Declare Function MsiSetMode lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal eRunMode As Struct_MembersOf_MSIRUNMODE, ByVal fState As Long) As Long
Declare Function MsiSetTargetPath lib "MSI" (ByRef hInstall As MSIHANDLE, ByVal szFolder As String, ByVal szFolderPath As String) As Long
Declare Function MsiSourceListAddSource lib "MSI" (ByVal szProduct As String, ByVal szUserName As String, ByVal dwReserved As Long, ByVal szSource As String) As Long
Declare Function MsiSourceListClearAll lib "MSI" (ByVal szProduct As String, ByVal szUserName As String, ByVal dwReserved As Long) As Long
Declare Function MsiSourceListForceResolution lib "MSI" (ByVal szProduct As String, ByVal szUserName As String, ByVal dwReserved As Long) As Long
Declare Function MsiSummaryInfoGetProperty lib "MSI" (ByRef hSummaryInfo As MSIHANDLE, ByVal uiProperty As Long, ByRef puiDataType As Long, ByRef piValue As Long, ByRef pftValue As FILETIME, ByVal szValueBuf As String, ByRef pcchValueBuf As Long) As Long
Declare Function MsiSummaryInfoGetPropertyCount lib "MSI" (ByRef hSummaryInfo As MSIHANDLE, ByRef puiPropertyCount As Long) As Long
Declare Function MsiSummaryInfoPersist lib "MSI" (ByRef hSummaryInfo As MSIHANDLE) As Long
Declare Function MsiSummaryInfoSetProperty lib "MSI" (ByRef hSummaryInfo As MSIHANDLE, ByVal uiProperty As Long, ByVal uiDataType As Long, ByVal iValue As Long, ByRef pftValue As FILETIME, ByVal szValue As String) As Long
Declare Function MsiUseFeature lib "MSI" (ByVal szProduct As String, ByVal szFeature As String) As INSTALLSTATE
Declare Function MsiUseFeatureEx lib "MSI" (ByVal szProduct As String, ByVal szFeature As String, ByVal dwInstallMode As Long, ByVal dwReserved As Long) As INSTALLSTATE
Declare Function MsiVerifyDiskSpace lib "MSI" (ByRef hInstall As MSIHANDLE) As Long
Declare Function MsiVerifyPackage lib "MSI" (ByVal szPackagePath As String) As Long
Declare Function MsiViewClose lib "MSI" (ByRef hView As MSIHANDLE) As Long
Declare Function MsiViewExecute lib "MSI" (ByRef hView As MSIHANDLE, ByRef hRecord As MSIHANDLE) As Long
Declare Function MsiViewFetch lib "MSI" (ByRef hView As MSIHANDLE, ByRef phRecord As MSIHANDLE) As Long
Declare Function MsiViewGetColumnInfo lib "MSI" (ByRef hView As MSIHANDLE, ByVal eColumnInfo As Struct_MembersOf_MSICOLINFO, ByRef phRecord As MSIHANDLE) As Long
Declare Function MsiViewGetError lib "MSI" (ByRef hView As MSIHANDLE, ByVal szColumnNameBuffer As String, ByRef pcchBuf As Long) As MSIDBERROR
Declare Function MsiViewModify lib "MSI" (ByRef hView As MSIHANDLE, ByVal eModifyMode As Struct_MembersOf_MSIMODIFY, ByRef hRecord As MSIHANDLE) As Long



Windows Installer API Functions by Category

To quickly navigate to a function category, click on one of the options below.

  • MSI Property and Mode Functions [MsiSetProperty,MsiGetProductInfo,MsiGetProperty,MsiGetLanguage,MsiGetMode]
  • Feature and Component Functions [MsiGetFeatureState,MsiSetFeatureState,MsiSetFeatureAttributes,MsiGetFeatureValidStates,
          • MsiGetComponentState,MsiSetComponentState,MsiGetFeatureCost,MsiSetInstallLevel]
  • Directory Functions [MsiGetSourcePath,MsiGetTargetPath,MsiSetTargetPath,MsiVerifyDiskSpace]
  • Database Functions [MsiEvaluateCondition,MsiGetActiveDatabase,MsiDatabaseApplyTransform,MsiDatabaseExport,
          • MsiDatabaseGenerateTransform,MsiDatabaseGetPrimaryKeys,MsiDatabaseImport,
          • MsiDatabaseIsTablePersistent,MsiDatabaseMerge,MsiDatabaseOpenView,MsiFormatRecord,
          • MsiViewModify,MsiOpenDatabase,MsiViewClose,MsiViewExecute,MsiViewFetch,MsiRecordGetString,
          • MsiRecordSetString,MsiRecordReadStream,MsiRecordSetStream,MsiRecordGetInteger,MsiRecordSetInteger,MsiViewGetColumnInfo,
          • MsiRecordGetFieldCount,MsiCloseHandle,MsiCloseAllHandles,MsiViewGetError]
  • Summary Information Stream Management Functions [MsiGetSummaryInformation,MsiSummaryInfoGetProperty,MsiSummaryInfoSetProperty]
  • Miscellaneous Functions [MsiApplyPatch,MsiCreateRecord,MsiDoAction,MsiEvaluateCondition,MsiInstallProduct,MsiOpenPackage,MsiPreviewBillboard,
          • MsiPreviewDialog,MsiProcessMessage,MsiSequence]





MSI Property and Mode Functions




MsiSetProperty Sets the value of a Windows Installer property. Creates the property if it does not exist. (For an example, see Get or Set a Property.)
MsiGetProductInfo Returns product information for published and installed products.
MsiGetProperty Gets the value of a Windows Installer property. Returns a null string ("") if the property does not exist.
MsiGetLanguage Returns the numeric language ID for the running installation.
MsiGetMode Returns an internal boolean Installer state.
MsiSetMode Sets an internal boolean Installer state.

Feature and Component Functions

MsiGetFeatureState Gets the installation state and action state of a feature.
MsiSetFeatureState Sets the installation state of a feature.
MsiSetFeatureAttributes:Sets the attributes for a feature.
MsiGetFeatureValidStates:Returns a set of bit flags representing the valid installation states of a feature.
MsiGetComponentState Gets the installation state and action state of a component.
MsiSetComponentState Sets the installation state of a component.
MsiGetFeatureCost Returns the disk cost of a feature (in units of 512 bytes), and optionally its parent and child features.
MsiSetInstallLevel Sets the install level for the entire product.

Directory Functions

MsiGetSourcePath Returns the full source path for a directory listed in the Directory table. (The Directory table is exposed in the Direct Editor.)
MsiGetTargetPath Returns the full target path for a directory listed in the Directory table.
MsiSetTargetPath Sets the full target path for a directory listed in the Directory table.
MsiVerifyDiskSpace Verifies if sufficient disk space exists for the current installation.

Database Functions

With the exception of MsiGetActiveDatabase, the first HWND argument in most of these functions is a handle to a specific database view or record.

MsiEvaluateCondition Evaluates a conditional expression that contains property names and values.
MsiGetActiveDatabase Obtains a handle to the running .msi database, which you can use to open database views.
MsiDatabaseApplyTransform: Applies a transform to a database. A transform is a way of recording changes to a database without altering the original database.
MsiDatabaseExport Exports an installer table from an open database to a text archive file.

MsiDatabaseGenerateTransform Generates a transform file of differences between two databases. A transform is a way of recording changes to a database without altering the original database.

MsiDatabaseGetPrimaryKeys Returns a record containing the names of all the primary key columns for a specified table. This function returns a handle that should be closed using MsiCloseHandle.

MsiDatabaseImport Imports an installer text archive table into an open database.
MsiDatabaseIsTablePersistent Returns an enumeration describing the state of a particular table.
MsiDatabaseMerge Merges two databases together, allowing duplicate rows.
MsiDatabaseOpenView Prepares a database query, creating a view object.
MsiFormatRecord Formats record field data and properties using a format string.
MsiViewModify Modifies a database record. For a running installation, only temporary database changes are allowed.
MsiOpenDatabase Opens a database file for data access. This function returns a handle that should be closed using MsiCloseHandle.
MsiViewClose Closes an executed database view.
MsiViewExecute Executes a SQL query.
MsiViewFetch Fetches a record for the current database view.
MsiRecordGetString Returns the string stored in a specific field of the specified record.
MsiRecordSetString Sets the string stored in a specific field of the specified record.
MsiRecordReadStream Returns the string value of a record field.
MsiRecordSetStream Sets a record stream field from a file. Stream data cannot be inserted into temporary fields.
MsiRecordGetInteger Returns the integer stored in a specific field of the specified record.
MsiRecordSetInteger Sets the integer stored in a specific field of the specified record.
MsiViewGetColumnInfo Returns a record containing database column names or definitions.
MsiRecordGetFieldCount:Returns the number of fields (columns) in a record.
MsiCloseHandle Closes a database, view, or record handle.
MsiCloseAllHandles Closes all open handles. Provided for diagnostic purposes, and should not be called for general cleanup.
MsiViewGetError Returns an error code for an error generated by MsiViewModify.

Summary Information Stream Management Functions

MsiGetSummaryInformation obtains a handle to summary information data for an installer database. This function returns a handle that should be closed using MsiCloseHandle.

MsiSummaryInfoGetProperty Gets a single property from the summary information.
MsiSummaryInfoSetProperty Sets a single summary information property.

Miscellaneous Functions

MsiApplyPatch For each product listed by the patch package as eligible to receive the patch, the MsiApplyPatch function invokes an installation and sets the PATCH property to the path of the patch package.

MsiCreateRecord Creates a new record object with the specified number of fields. This function returns a handle that should be closed using MsiCloseHandle.
MsiDoAction Executes a built-in action, custom action, or user-interface wizard action.
MsiEvaluateCondition Evaluates a conditional expression containing property names and values.
MsiInstallProduct Installs or uninstalls a product.
MsiOpenPackage Opens a package for use with the functions that access the product database. The MsiCloseHandle function must be called with the handle when the handle is no longer needed.

MsiPreviewBillboard Displays a billboard within a host control in the displayed dialog. Supplying a null billboard name removes any billboard displayed.
MsiPreviewDialog Displays a dialog box as modeless and inactive.
MsiProcessMessage Sends an error record to the installer for processing.
MsiSequence Executes another action sequence, as described in the specified table.














Related Raadings:
1. Windows Installer Development Tools
2. A couple of notes about the contents of the Windows Installer 4.5 SDK
3. Windows Installer Tools & Tips
4. Wrapping the Windows Installer 2.0 API
5. Installer Functions

















Install/Uninstall Customization [from other link]

How to create a custom install program

[From the link specified in the reference]
Note: I've searched the various links to get information at one place. I've not checked the help for validation. So I'm not responsible for any issue found related to the contents specified in the blog. Please use contents at own risk.

Summary To deploy stand-alone applications (.exe) or in-process components (.dll), you can create a custom installation program using Visual Studio or third-party installation software such as Wise or InstallShield. By using Visual Studio, it is possible to create a custom install program that deploys and registers your components—the key being the System.Runtime.InteropServices.RegistrationServices class. This class has the RegisterAssembly and UnregisterAssembly members, which register and unregister managed classes with component object models (COM). These are the same functions the RegAsm utility uses. Using these functions inside a custom installer class along with a setup program is the complete solution.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo


Deploying a .NET component customization

The steps in this article show how to deploy a .NET component customization; for example, a class library developed in .NET that provides custom commands and tools.
The technique described in this article assumes that ArcGIS is installed on the target machine.
  1. In Visual Studio, open a .NET solution that already contains a class library project with at least one class exposed to COM; for example, a custom command class. You may want to create your command using Visual Studio IDE Integration features of the .NET SDK.
For more information on using the Visual Studio IDE integration to create you own custom ArcGIS based COM components see About the ArcGIS item templates.
  1. In the Solution Explorer, right click on the project name and choose 'Add' > 'New Item' and then choose 'Installer Class' from the New Item dialog. See the following screen shot:
You will need to have a name for your class other than "Installer" as that is the name of the class in System.Configuration.Install that your install class will inherit from.
  1. The next step is to override the install and uninstall functions implemented in the installer base class. You use the RegistrationServices class RegisterAssembly and UnregisterAssembly methods to register the components. Make sure you use the SetCodeBase flag to indicate that the code base key for the assembly is set in the registry. The RegistrationServices class is found in the System.Runtime.InteropServices namespace. To accomplish this, first add a new imports or using statement at the top of the class. See the following:

[C#]
using System.Runtime.InteropServices;

[VB.NET]
Imports System.Runtime.InteropServices
Then, add the following code inside of the installer class:
[C#]
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
RegistrationServices regSrv = new RegistrationServices();
regSrv.RegisterAssembly(base.GetType().Assembly,
AssemblyRegistrationFlags.SetCodeBase);
}

public override void Uninstall(System.Collections.IDictionary savedState)
{
base.Uninstall(savedState);
RegistrationServices regSrv = new RegistrationServices();
regSrv.UnregisterAssembly(base.GetType().Assembly);
}

[VB.NET]
Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
MyBase.Install(stateSaver)
Dim regsrv As New RegistrationServices
regsrv.RegisterAssembly(MyBase.GetType().Assembly, AssemblyRegistrationFlags.SetCodeBase)
End Sub

Public Overrides Sub Uninstall(ByVal savedState As System.Collections.IDictionary)
MyBase.Uninstall(savedState)
Dim regsrv As New RegistrationServices
regsrv.UnregisterAssembly(MyBase.GetType().Assembly)
End Sub
  1. At this point you must re-build your project to ensure that the latest version of all the project files get included in the setup program. Choose Build > Rebuild Solution from the Visual Studio menus.
If you want your application to be able to work across different versions of assemblies, you may need to specify that in the properties of any referenced assemblies. You can do this by clicking on a specific assembly in the References section of the Solution Explorer and setting the 'Specific Version' to False. Do this before you re-build your project.
  1. Add a setup program to your solution by choosing 'File' > 'New Project' from the menus. On the Add New Project dialog box, select Setup and Deployment in the Project types area, then click Setup Project in the Templates area. Name the new project and click OK to add the new setup project to your solution. See the following screen shot:

  1. In the Solution Explorer, right-click the new Setup project, click Add, then select Project Output. Choose the project you want to deploy. Select Primary output and click OK. See the following screen shot:

  1. From the list of detected dependencies that is regenerated, exclude all references to ESRI primary interop assemblies; for example, ESRI.ArcGIS.System. Also exclude the Stdole.dll reference. The only items typically left in the list are the .tlb file, Microsoft .NET Framework file, and the Primary output from the file, which represents the .dll or .exe you are compiling. See the following screen shot:

You should never include ArcGIS assemblies in your deployment package as these are installed by the ArcGIS installation program.
  1. Additionally, you need to change the value of the Register property for the .tlb file. By default, the .tlb file is set to be registered with COM at install time. However, this causes an error during installation. To accomplish this, right-click the .tlb file in the project's detected dependencies tree node. In the Properties pane, set the value of the Register property to vsdrfDoNotRegister before compiling the installer. See the following screen shot:

  1. The final steps involve associating the custom installation steps configured in the new installer class with the setup project. To do this, right-click the setup project in the Solution Explorer, choose View, then choose Custom Actions. See the following screen shot:

  1. In the resulting custom actions for the installation project, right-click the Install folder and choose Add Custom Action. See the following screen shot:

  1. On the Select Item in Project dialog box, double-click Application Folder. See the following screen shot:

  1. From the Application Folder, double-click the Primary output from the file to associate the custom install function created earlier with the setup's custom install action. See the following screen shot:

  1. Repeat this process for the setup's uninstall. See the following screen shot:

  1. Rebuild the entire solution to generate the setup's executable.
A setup project is not built by default. In the Solution Explorer, you can right-click the setup project and click Build to build the setup project. You can also right-click the solution and choose Configuration Manager, then on the Configuration Manager dialog box, select the Build option for the setup project before rebuilding the solution.
Running the setup executable on a target machine installs the components and registers them with COM. The COMRegisterFunction routine then registers the components in the appropriate component categories.
Please note that you must uninstall the custom component before you attempt to uninstall ArcGIS. The reason for that is that custom components need to loaded at install/uninstall time. When loading the .NET Framework loads the custom component it must also load all referenced assemblies (eg "ESRI.ArcGIS.ArcMap.dll" and "ESRI.ArcGIS.System.dll"). If these referenced assemblies are missing at install/uninstall time then the install/uninstall will fail.


Referecnce:

How to create a custom install program

Study Links:

1. How to create a custom install program

2. Custom Actions - Part 1

Installation setup in VB.net

Note: I've searched the various links to get information at one place. I've not checked the help for validation. So I'm not responsible for any issue found related to the contents specified in the blog. Please use contents at own risk.


Visual Studio 2005 Setup and deployment Projects provides to make a exe in .NET windows application is easy and rapidly

Visual Studio provides templates for four types of deployment projects: Merge Module Project, Setup Project, Web Setup Project, and Cab Project. In addition, a Setup wizard is provided to help step you through the process of creating deployment projects. You can see the templates and the wizard in the New Project dialog box under the Setup and Deployment Projects node.

The following are guidelines for choosing the right type of deployment project for your project.

1)Merge Module Project : Packages components that might be shared by multiple applications.

2)Setup Project : Builds an installer for a Windows-based application.

3)Web Setup Project : Builds an installer for a Web application.

4)Cab Project : Creates a cabinet file for downloading to a legacy Web browser.

5)Smart Device Cab Project : Creates a Cab project to deploy device applications.

This topic demonstrates deployment using a Setup and Deployment Project.

Setup Projects

Setup projects allow you to create installers in order to distribute an application. The resulting Windows Installer (.msi) file contains the application, any dependent files, information about the application such as registry entries, and instructions for installation. When the .msi file is distributed and run on another computer, you can be assured that everything necessary for installation is included; if for any reason the installation fails (for example, the target computer does not have the required operating system version), the installation will be rolled back and the computer returned to its preinstallation state.

After you have developed your windows apllication,now you want to make a exe.how can? These steps are gives the guidance to you…

1, Go to file menu > click Add > new project >now “Add New Project” Dialog appear.

2.Select “Other Project Types” and click “Setup and Deployment” projects,Choose “Setup Project”give name project name in name text box finally click OK.

3.New project appear in solution explorer,for example you give the name “MyEXE”..it will display with this name.

4.right click the MyEXE > go View > click “File System”

5.You can see the “File System on TargetMachine”under three folders
Application Folder
User’s Desktop
User’s Program Menu

6.Select Application Folder and right click Add>Project Output>select Primary output

7. select User’s Desktop richt click on the second window>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE

next >>

same procedure follows the user’s program menu also

8.If you want to change the Manufactures name for exe,just right click the project go to properties

change the properties as per you requirement

9.Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)

EXE available @ this location

When you want to install the EXE on the client machine,you should be installed .NET Framework on that mc because,Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs.


Reference: [http://balanagaraj.wordpress.com/2007/05/29/create-exe-or-setup-file-in-net-windows-application/]

Other Study Links:

1. Microsoft .NET Creating Installation Components

2. Deployment options for Visual Studio .NET 2.0 overview

3. Developing Visual Studio Project Wizards

4. Deploy Windows Applications with Visual Studio.NET, Part 1