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: Writing Files to Users\Public
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
‎Oct 28, 2008
10:34 AM
Writing Files to Users\Public
Another title could be (I need a DATADIR that is similar to TARGETDIR).
We have some .mdb and other files that we reformat durning app-run, according to Vista we need to have those files in \Users\Public\[Company]\[Product]. I have the following code stubbed out:
I have a dialog for the User to change this value (if desired) using SdAskDestPath2 so the value of szPath could change. What can I replace szPath with so I can write those files in that location (Organization-Setup Design-Component-Destination)?
Thanks.
We have some .mdb and other files that we reformat durning app-run, according to Vista we need to have those files in \Users\Public\[Company]\[Product]. I have the following code stubbed out:
if (SYSINFO.WINNT.bWinVista) then
szPath= TARGETDISK + "\\Users\\Public\\" + IFX_COMPANY_NAME + "\\" + IFX_PRODUCT_NAME;
else
szPath = TARGETDIR;
endif;
I have a dialog for the User to change this value (if desired) using SdAskDestPath2 so the value of szPath could change. What can I replace szPath with so I can write those files in that location (Organization-Setup Design-Component-Destination)?
Thanks.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2008
01:15 PM
Ok, found that I can "Browse for Directory" in Organization-Setup Design-Component-Destination, then under "Script-defined Folders" create a "DATADIR" destination.
This then changes my if block to:
and my dialog to:
However I cannot "get" the value of DATADIR anywhere else because of compiler errors. But no harm because I can use it in functions such as:
I just can't do:
This then changes my if block to:
if (SYSINFO.WINNT.bWinVista) then
szPath = TARGETDISK + "\\Users\\Public\\" + IFX_COMPANY_NAME + "\\" + IFX_PRODUCT_NAME;
else
szPath = TARGETDIR;
endif;
FeatureSetTarget(MEDIA, "", szPath);
and my dialog to:
szDir = szPath;
if (nSetupType = CUSTOM) then
nResult = SdAskDestPath2( szTitle, szMsg, szDir );
FeatureSetTarget(MEDIA, "", szDir);
However I cannot "get" the value of DATADIR anywhere else because of compiler errors. But no harm because I can use it in functions such as:
RegDBSetKeyValueEx (szRegKey, "Data Path", REGDB_STRING, "",-1);
I just can't do:
szDir = "Which is unfortunate."
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2008
03:35 PM
Ben,
You just have to drop the quotes and < > from your assignment, like this...
You just have to drop the quotes and < > from your assignment, like this...
szDir = DATADIR;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 29, 2008
07:40 AM
When I use:
szDir = DATADIR;
I get the following errors during Compile:
error C8025: 'DATADIR' : undefined identifier
error C8039: string value required
My if block is above this assignment call so it has a value. DATADIR doesn't turn blue like TARGETDIR does, so I don't know what I'm missing.
Thanks for your reply.
szDir = DATADIR;
I get the following errors during Compile:
error C8025: 'DATADIR' : undefined identifier
error C8039: string value required
My if block is above this assignment call so it has a value. DATADIR doesn't turn blue like TARGETDIR does, so I don't know what I'm missing.
Thanks for your reply.
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 29, 2008
12:49 PM
BenjaminWilliam wrote:
When I use:
szDir = DATADIR;
I get the following errors during Compile:
error C8025: 'DATADIR' : undefined identifier
error C8039: string value required
My if block is above this assignment call so it has a value. DATADIR doesn't turn blue like TARGETDIR does, so I don't know what I'm missing.
Thanks for your reply.
DATADIR is not an InstallScript defined variable, so it wouldn't get highlighted like TARGETDIR would.
I think DATADIR would be a Script Defined Variable in most cases. You may want to review the help topic titled, "Adding a ScriptDefinedVar Property to Your Object " for more information on these types of variables.