This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Control the Installation screens of .MSI
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2010
04:52 AM
Control the Installation screens of .MSI
Hello,
My requirement is to open the MSI database to edit. Various properties and installatin of featues can be controlled by using Windows Installer Apis by calling "MsiOpenPackage" and sequential functions from Installer SDK.
But i also want to control the display of Installation screens. How can i acheive this by using Windows Installer SDK or via any other method.
E.g: I want to create a customised packge from a reqular package in which my end user should not able to see the "License Agreement" dialog and also culd not see the "Feature Selection" dialog. Please suggest ways to acheive this functionality. My .MSI has been compiled via IS 2009 and is a Basic MSI project.
Regards,
My requirement is to open the MSI database to edit. Various properties and installatin of featues can be controlled by using Windows Installer Apis by calling "MsiOpenPackage" and sequential functions from Installer SDK.
But i also want to control the display of Installation screens. How can i acheive this by using Windows Installer SDK or via any other method.
E.g: I want to create a customised packge from a reqular package in which my end user should not able to see the "License Agreement" dialog and also culd not see the "Feature Selection" dialog. Please suggest ways to acheive this functionality. My .MSI has been compiled via IS 2009 and is a Basic MSI project.
Regards,
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2010
05:45 AM
There are a couple of ways that I know of editing the .msi file.
a) Use Orca tool available in the Windows Installer SDK
b) Use Installshiled
Its very easy to open the .msi files in either of the tools.
Once open in Orca you can clearly see all the tables. Its very easy to edit the tables and save your changes.
In Installshield, you need to use the Direct Editor to manipulate the UI.
Be careful though. UI sequences of complex applications can have many conditions attached to them. Be sure to keep the UI sequence flowing.
a) Use Orca tool available in the Windows Installer SDK
b) Use Installshiled
Its very easy to open the .msi files in either of the tools.
Once open in Orca you can clearly see all the tables. Its very easy to edit the tables and save your changes.
In Installshield, you need to use the Direct Editor to manipulate the UI.
Be careful though. UI sequences of complex applications can have many conditions attached to them. Be sure to keep the UI sequence flowing.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2010
09:42 PM
Hi,
Msiyer - Thnx for your reply. 🙂 Well i am aware of these ways to edit the MSI.
But i want to know how can i acheive this programmatically.
My client is not having ORCA or Installshield installed at his/her premises.
Are there any windows APIs to acheive the same
Regards,
Msiyer - Thnx for your reply. 🙂 Well i am aware of these ways to edit the MSI.
But i want to know how can i acheive this programmatically.
My client is not having ORCA or Installshield installed at his/her premises.
Are there any windows APIs to acheive the same
Regards,
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 12, 2010
03:23 AM
There are APIs available to achieve what you want.
TCHAR szQuery[MIN_BUFFER_LENGTH] = {0};
_tcscpy(szQuery,
TEXT("SELECT `Value` "
"FROM `Property` "
"WHERE Property = 'ProductVersion'"));
This Installer SQL subset query, for example, would get the value of 'ProductVersion' from the .msi database.
MsiOpenDatabase is used to open the database file for the transaction. You can use various parameters to define the type of transaction(a read-only or a write).
MsiDatabaseOpenView is then used for preparing the transaction and creating the view. The query is applied on the view and it is the live object with which you will interact.
MsiViewExecute will execute the transaction on the view.
MsiViewFetch will fetch you the required values from the view.
MsiRecordGetString actually extracts values. You should provide the exact column number from which to extract the value.
It is quite complex to perform.
Do look into these functions and understand how you can use them in your case.
Sample Pseudocode:
//Construct the query
TCHAR szQuery[MIN_BUFFER_LENGTH] = {0};
_tcscpy(szQuery,
TEXT("SELECT `Value` "
"FROM `Property` "
"WHERE Property = 'ProductVersion'"));
//handle to the .msi database
PMSIHANDLE hDatabase = NULL;
CHECK_MSI(MsiOpenDatabase(szMSIFile, MSIDBOPEN_READONLY, &hDatabase)) //open the database as readonly in this case
PMSIHANDLE hView = NULL;
CHECK_MSI(MsiDatabaseOpenView(hDatabase, szQuery, &hView));
CHECK_MSI(MsiViewExecute(hView, 0));
UINT unResult = ERROR_SUCCESS;
PMSIHANDLE hRecord = NULL; //handle to the record
if (ERROR_SUCCESS == MsiViewFetch(hView, &hRecord))
{
TCHAR szData[MIN_BUFFER_LENGTH] = {0};
DWORD dwSize = MIN_BUFFER_LENGTH;
CHECK_MSI(MsiRecordGetString(hRecord, 1, szData, &dwSize));
}
This is a C++ code snippet.
Also follow this link:
http://www.koders.com/csharp/fidEF7DC1EF2026543044B67E981A4E9C9EE2FB23AF.aspx?s=nativemethods
Hope this helps.
NOTE:
You can give the client the Orca and all necessary info and ask him/her to perform the edit.
TCHAR szQuery[MIN_BUFFER_LENGTH] = {0};
_tcscpy(szQuery,
TEXT("SELECT `Value` "
"FROM `Property` "
"WHERE Property = 'ProductVersion'"));
This Installer SQL subset query, for example, would get the value of 'ProductVersion' from the .msi database.
MsiOpenDatabase is used to open the database file for the transaction. You can use various parameters to define the type of transaction(a read-only or a write).
MsiDatabaseOpenView is then used for preparing the transaction and creating the view. The query is applied on the view and it is the live object with which you will interact.
MsiViewExecute will execute the transaction on the view.
MsiViewFetch will fetch you the required values from the view.
MsiRecordGetString actually extracts values. You should provide the exact column number from which to extract the value.
It is quite complex to perform.
Do look into these functions and understand how you can use them in your case.
Sample Pseudocode:
//Construct the query
TCHAR szQuery[MIN_BUFFER_LENGTH] = {0};
_tcscpy(szQuery,
TEXT("SELECT `Value` "
"FROM `Property` "
"WHERE Property = 'ProductVersion'"));
//handle to the .msi database
PMSIHANDLE hDatabase = NULL;
CHECK_MSI(MsiOpenDatabase(szMSIFile, MSIDBOPEN_READONLY, &hDatabase)) //open the database as readonly in this case
PMSIHANDLE hView = NULL;
CHECK_MSI(MsiDatabaseOpenView(hDatabase, szQuery, &hView));
CHECK_MSI(MsiViewExecute(hView, 0));
UINT unResult = ERROR_SUCCESS;
PMSIHANDLE hRecord = NULL; //handle to the record
if (ERROR_SUCCESS == MsiViewFetch(hView, &hRecord))
{
TCHAR szData[MIN_BUFFER_LENGTH] = {0};
DWORD dwSize = MIN_BUFFER_LENGTH;
CHECK_MSI(MsiRecordGetString(hRecord, 1, szData, &dwSize));
}
This is a C++ code snippet.
Also follow this link:
http://www.koders.com/csharp/fidEF7DC1EF2026543044B67E981A4E9C9EE2FB23AF.aspx?s=nativemethods
Hope this helps.
NOTE:
You can give the client the Orca and all necessary info and ask him/her to perform the edit.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 15, 2010
02:02 AM
Thnx MSIYER. 🙂