PDA

View Full Version : SubDirs and Files of DATABASEDIR not created



rjhessey
12-12-2004, 01:50 AM
I am running a VBScript custom action after initialization (before first dialog). This action gets a path from the registry and assigns it to DATABASEDIR. During the install process, the Database Folder dialog is displayed, allowing the user to change the path if needed. The script seems to be working appropriately since the path retrieved from the registry is displayed on the Database Folder dialog. In my testing, the path in the registry is different than the default path entered for the DATABASEDIR in the project.

THE ISSUE -
After the install completes, the files to be installed in the DATABASEDIR do exist. However, the sub-directories are not created and the files in these sub-directories do not exist.

A TWIST -
When the Database Folder dialog appears, the Change button is clicked. Without doing anything on the Change Current Destination Folder dialog (i.e. the path is not touched), the OK button is clicked. The same path remains on the Database Folders dialog. Now, the files in the DATABASEDIR exist and all sub-directories are created and the files in these sub-directories exist.

So, it appears that simply setting the DATABASEDIR property from the VBScript doesn't force the installation of sub-directories nor files.

I have attached a document with information from my project and the script.

Any thoughts or ideas on this?

Thanks for any and all assistance,
~Randy

rjhessey
12-13-2004, 06:02 PM
After further testing, I have an update...

I simplified the VBScript so that the DATABASEDIR is only set if it is found in the registry.
Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
sKey = "SOFTWARE\Preeminent Technologies\ProfitMaxx"
sName = "DatabasePath"
sDatabasePath = ""
If oRegistry.GetStringValue(HKEY_LOCAL_MACHINE, sKey, sName, sDatabasePath) = 0 Then
If Right(sDatabasePath, 1) <> "\" Then
sDatabasePath = sDatabasePath & "\"
End If
Session.Property("DATABASEDIR") = sDatabasePath
End If
Set oRegistry = nothing


Now, re-confirmation of the issue...

If the DATABASEDIR is NOT set via the script, sub-directories and files ARE installed.

If the DATABASEDIR is set via the script and...
1) the path from the registry is different than the default set in the project, sub-directories and files are NOT installed.
2) the path from the registry is the same as the default set in the project, sub-directories and files ARE installed.
3) the path from the registry is different than the default set in the project and the change button is clicked on the Database Folders dialog, sub-directories and files ARE installed.


So, it still seems that simply setting the DATABASEDIR in the script does not force the installation of sub-directories and files.

Thanks again for any assistance.
Randy

rjhessey
12-14-2004, 08:02 PM
In trying more and more options to resolve this or find a work-around, I set a hard-coded path for files originally associated to the INSTALLDIR. Rather than using DATABASEDIR for my data files and sub-folders, I tried using INSTALLDIR.

Using the same code as before, I retrieved a path from the registry and assigned it to INSTALLDIR.

The same results occur! If on the Destination Folder dialog, the Change button is not selected, any and all sub-folders and files of INSTALLDIR are NOT created.

Does anyone know if support staff from InstallShield monitor these threads? If so, this should be verified as a possible bug.

Thanks to anyone who may have an idea for a resolution.
Randy

rjhessey
12-16-2004, 12:24 PM
I submitted this issue to InstallShield technical support. They were able to replicate the issue and provided a possible solution. After my own testing, I believe we have a work-around resolution.

From InstallShield Support...
"I have been able to replicate this issue if I sequence the VBScript custom action in certain spots within the installation. I have been successfully gotten this to work if I sequence the custom action Before System Search (Not in Silent Mode). When the custom action runs at this point in the installation, the path is shown correctly on the database folder dialog, and the folder and subfolders and their files are correctly installed."

So... if the DATABASEDIR and INSTALLDIR are set Before System Search then all files are installed appropriately.

Randy