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: Installing database Files
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
‎Jan 08, 2008
10:51 AM
Installing database Files
I'd like to have a user be allowed to install the MDF and LDF files for a database to a destination other than the TARGETDIR. I have a create script and a custom dialog that asks for the location of that directory but I can't figure out how to put the directory into the create script.
Can i assign a property into the text replacement tab or is there a function I need to call to make this work?
Can i assign a property into the text replacement tab or is there a function I need to call to make this work?
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
11:28 AM
What project type are you using?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
11:29 AM
It's an install script project
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
02:14 PM
Here is a sample SQL script and a text replacement entry that will create a database using a database file installed to a script-defined folder.
Find What: %MyDatabaseDir%
Replace With:
Hope this helps.
CREATE DATABASE TestDB
ON
( NAME = TestDb_dat,
FILENAME = %MyDatabaseDir%\testdbdat.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
GO
Find What: %MyDatabaseDir%
Replace With:
Hope this helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
02:37 PM
hidenori wrote:
Find What: %MyDatabaseDir%
Replace With:
Where do I define NEW_DIRECTORY1 for that to work, and how do I access it form the Installscript?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
02:49 PM
A script-defined folder can be created using the Browse for Directory dialog that can be launched from the Destination property grid in the Components view. You can call the FeatureSetTarget() function to assign a target location to the folder that you create.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
03:06 PM
Thanks that solved my problem nicely. What does the first argument of the FeatureSetTarget function mean though? I'm using MEDIA and it works but I'd like to know why.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
03:26 PM
With InstallScript, the special value MEDIA used as the first argument to feature functions just refers to the file-based InstallScript .cab files. Using a value other than MEDIA indicates a script-created media set with fake features created with FeatureAddItem and FeatureSetData.
The InstallScript help topics "MEDIA" and "Script-Created Feature Set vs. File Media Library" give a little more information.
The InstallScript help topics "MEDIA" and "Script-Created Feature Set vs. File Media Library" give a little more information.
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)