cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterbi
Level 7

How to get 'ProgramData' folder in a pure InstallScript project?

Hi,

I want to get 'ProgramData' folder in a pure InstallScript project (no MSI), and use it as the database file destination for Vista and later platforms. What is the reliable and simple way to do it in InstallScript code?


Thanks,
Peter
Labels (1)
0 Kudos
(4) Replies
peterbi
Level 7

Ok, I made it by calling SHFolder.SHGetFolderPathA() in IS script.

The next problem for me is how to set the retuned path value to be the destination of some components, those components are marked to be installed only on Vista and Win Server 2008.

Again, since the install type is pure InstallScript (no MSI), all the methods (Property, CA, and so on) I am familia with for MSI are not available now. I know there is a way in pure script to call FeatureSetTarget(), but I would prefer (and am used) to make it available in the 'Setup Design' phase, making it (which can be set by script code at the early stage of installation) as a property/folder_name/etc.

Any suggestions?


Thanks,
Peter
0 Kudos
Holger_G
Level 10

It´s simple.
Just create a 'Script-defined Folder' and use it as (part of) the destination for those components. Assign the real folder using FeatureSetTarget to the script defined folder.

Example:
Script-defined Folder is CommonAppData.
Assign Folder to CommonAppData:
FeatureSetTarget( MEDIA, "", szCommonAppDataFolder);
0 Kudos
peterbi
Level 7

That seems to be what I have to do - I originally wanted to avoid FeatureSetTarget() call and hoped to have other ways that works with just IDE (configurations/set property/etc.).


Thanks for your reply.
0 Kudos
MEbert
Level 2

hi,

why you don´t use "commonappdata" (IS)variable?

greetings michael
0 Kudos