cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
davidgid
Level 3

Create Catalog If Absent not Working

History:I was new to Installshield when we did our first release and did not version any of my SQL scripts. In that install we created a database named: UserData

Current Change:Now we are sending out a new release and due to the complexity of the database and the fact that we did not version the data it will be easier for us to just create a new database named: UserData1_1

We have written scripts to copy over the data from the original "UserData" database to the new "UserData1_1". Going forward we have all the scripts versioned so we will not have this problem again.

Problem:When I install the new version of the application on a machine that does not have the old version everything works perfectly. If the older version is on the computer and we are trying to upgrade it will not create the new database even when the "Create Catalog If Absent" is checked.


I was able to create the new database in a script during the update, but because we are not connected to the new database the Installshield version table is being created inside fo the Master database. That of course has lead to a whole new host of problems.

Question: When doing an update Installshield looks to be assuming that the database was installed in a previous version is already there. Does anyone know where that flag is set or how to resolve this issue?
Labels (1)
0 Kudos
(8) Replies
davidgid
Level 3

Under the Connection it says:
"Specify the catalog name to work with and optionally the server name and authentication settngs to default to on the SQL Login dialog shown during the installation process. You can also enter any comments regarding this connection, launch the Database Import Wizard, and view the SQL Login end-user dialog."

The thing is on an update my login dialog is not showing. I've attached the dialog that does not show on an update.

I am using InstallShield 2011 Professional Edition and my project is an InstallScript Project
0 Kudos
ch_eng
Level 7

davidgid wrote:
The thing is on an update my login dialog is not showing. I've attached the dialog that does not show on an update.


Are you explicitly calling this dialog in the OnResumeUIBefore() (or similar) section of your Setup.rul?

HTH
0 Kudos
davidgid
Level 3

I have not manually edited my setup.rul. Should I? I was looking in that script file, but it is not obvious as to how I would call that dialog box on an update. Is that what you are suggesting?
0 Kudos
ch_eng
Level 7

I would recommend reading a few of the help files to get you started with custom dialogs. In my own limited experience, I can tell you that OnResumeUIBefore() is the "Patch" section for a minor upgrade. Here are a few links that might help you with getting custom dialogs to work:

http://kb.flexerasoftware.com/doc/Helpnet/installshield16helplib_sp1/Dialogs_CreateStandardDlgEd.htm

http://kb.flexerasoftware.com/doc/Helpnet/installshield16helplib_sp1/Dialogs_ImplementStandard.htm

http://kb.flexerasoftware.com/doc/Helpnet/installshield16helplib_sp1/mergedProjects/installshield16langref/LangrefEzDefineDialog.htm

http://kb.flexerasoftware.com/doc/Helpnet/installshield16helplib_sp1/Dialogs_ProcessControlsStandard.htm

I would also recommend getting to know how Setup.Rul and FeatureEvents.Rul work.

HTH
0 Kudos
davidgid
Level 3

I see where in the OnFirstUIBefore() function originally called this:

Dlg_SQLServer:
nResult = OnSQLServerInitialize( nResult );
if( nResult = BACK ) goto Dlg_SdFeatureTree;


I am guessing that I need to call that again on the update package to create the new database. I see a function called OnSetUpdateMode() but I do not see where it calls the dialogs. Do you know where the dialogs are called during an update?
0 Kudos
ch_eng
Level 7

davidgid wrote:
Do you know where the dialogs are called during an update?


For a Minor Upgrade, I think they are called during OnResumeUIBefore() If you don't see that function in your Setup.Rul, select "Miscellaneous" from the left dropdown and "OnResumeUIBefore" in the second. That will add the function with some calls to the default dialogs.

HTH
0 Kudos
davidgid
Level 3

Hey thanks for the help. You most certainly pointed me in the right direction. What I ended up doing last night was editing the function OnSetUpdateMode().
At the very bottom of the function after this line:
	UPDATEMODE = ( nMediaFlags & MEDIA_FLAG_FORMAT_DIFFERENTIAL || ( MAINTENANCE && ( nResult != VERSION_COMPARE_RESULT_SAME ) ) );


I added this
	if(UPDATEMODE) then
nResult=OnSQLServerInitialize( nResult );
endif;


I have some more testing to do today, but it seems to work okay.
0 Kudos
ch_eng
Level 7

Glad it's working. I didn't know about OnSetUpdateMode. That might just be in InstallScript projects. I have only worked with InstallScript MSI projects.
0 Kudos