PDA

View Full Version : Summary dialog in IS11.5



Elisha
01-03-2006, 04:20 AM
Hi,

What is the easiest way to create a summary dialog in InstallShield 11.5, Proffesional version? Which controls should I use?

Thanks

Elisha

RobertDickau
01-04-2006, 08:38 AM
What would you like the summary dialog box to look like? What would you like it to display?

Elisha
01-18-2006, 08:08 AM
Thanks for the reply. Sorry it took me so long - forgot to check up on it for a while...

What I would like is a dialog with a list of the settings the user chose during the UI sequence. The list should be with bold text for the catagories and regular indented text for the choices.

I am building a Basic MSI project.

Thanks again,

Elisha

RobertDickau
01-18-2006, 09:06 AM
You could use the dialog editor to add text to the ReadyToInstall dialog box, perhaps, taking advantage of the fact that Windows Installer expands the values of properties whose names you enclose in square brackets. For example, you could add a text field with Text value "Installing to: [INSTALLDIR]", and the installation directory the user selected will be displayed.

Elisha
01-23-2006, 01:38 AM
Hi,

Thanks for the idea, but if I'm not mistaken there are no escape sequences in IS and thus I would not be able to determine where a new line (\n) or tab should appear.

I know such a dialog must be possible somehow, since it appears in so many installations, so the two possibilities I've thought of were:
1. write to a file and then use the scrollable text control
2. perhaps such a dialog is only possible in a Installscript project - is this true? why?

any other ideas will be welcomed

thanks

Elisha

RobertDickau
01-23-2006, 08:59 AM
In the string editor window in the dialog editor, I believe you can press Ctrl+Enter to insert a line break.

Elisha
01-23-2006, 09:13 AM
Hi,

I've seen this idea (in your name, I believe) in some other thread. Have you tried this? I have IS11.5 and pressing ctrl+Enter gives the same results as does Enter - no results.

By the way - I tried the scrollable text idea and it does not work, since a scrollable text control loads the file related to it at the begining of the installation, so changes in the file as a result of the users choices cannot be reflected in this file.

Perhaps I should use a InstallScript custom action (I'm using Basic MSI project) to affect the text area. What do you think about this? woudl you know where I could find a sample code that writes to a text area?

Thanks again

RobertDickau
01-23-2006, 09:39 AM
Ctrl+Enter seems to work for me; you press it in the String Entry window (see attachment) that appears when you click the browse button for the Text property of a Text control, as opposed to editing it in line...

Elisha
01-25-2006, 01:04 AM
It works like a charm - Thanks alot! :)

Elisha
01-31-2006, 07:40 AM
The solution you proposed works mainly for single-feature installations. But for multiple features, where the user can choose any and all features, using your system would result in a most "messy" dialog in some cases. For example, you could get a big gap in the lines of the summary where a un-selected feature was supposed to be summerized.

In the meantime I've tried writing a custom action to change the text of the summary dialog at run-time, but cannot seem to do this. Any simple ways you could think of?

Thanks

Elisha

Elisha
02-13-2006, 02:06 AM
Ok - here is my solution:
1. in the "ReadyToInstall" dialog add another text area called "SummaryText".
2. use the following dll in C++, giving it a string of format "<catergory>=<value>;<catergory>=<value>;..." (without the brackets).
3. Write a c++ code which changes all ";" into "\n" and activate it in the correct position in the following code:


extern "C" __declspec(dllexport) UINT __stdcall DynamicSummary(MSIHANDLE hInstall, LPCTSTR sumValues)
{
MSIHANDLE hView, hDatabase;
MSIHANDLE hRec;
hDatabase = MsiGetActiveDatabase(hInstall);
UINT res1 = MsiDatabaseOpenView(hDatabase, "SELECT * FROM Control WHERE (Dialog_ = 'ReadyToInstall' AND Control = 'SummaryText')", &hView);
if (res1 != ERROR_SUCCESS)
{
// error message
}

UINT fetched2 = MsiViewExecute(hView, 0); // must do before Fetch
UINT fetched = MsiViewFetch(hView, &hRec);

if (fetched == ERROR_FUNCTION_FAILED)
{
//
}
if (fetched == ERROR_INVALID_HANDLE)
{
//
}
if (fetched == ERROR_INVALID_HANDLE_STATE)
{
//
}
if (fetched == ERROR_NO_MORE_ITEMS )
{
//
}

DWORD len = 255;
LPTSTR value = new TCHAR[len];

if(fetched == ERROR_SUCCESS) {
LPTSTR newSumValues = new TCHAR[strlen(sumValues)];

// REPLACE ";" WITH "\n" in sumValues

UINT res3 = MsiViewModify(hView, MSIMODIFY_DELETE, hRec);
if (res3 != ERROR_SUCCESS) {
// error message
}
MsiRecordSetString(hRec, 10, newSumValues);
UINT res2 = MsiViewModify(hView,SIMODIFY_INSERT_TEMPORARY, hRec);
if(res2 == ERROR_ACCESS_DENIED ) {
// error message
}
if(res2 == ERROR_FUNCTION_FAILED ) {
// error message
}
if(res2 == ERROR_INVALID_DATA ) {
// error message
}
if(res2 == ERROR_INVALID_HANDLE ) {
// error message
}
if(res2 == ERROR_INVALID_HANDLE_STATE ) {
// error message
}
if(res2 == ERROR_INVALID_PARAMETER ) {
// error message
}
}
MsiViewClose(hView);
return ERROR_SUCCESS;
}