How to get 'ProgramData' folder in a pure InstallScript project?
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?
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.
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.
Script-defined Folder is CommonAppData.
Assign Folder to CommonAppData:
FeatureSetTarget( MEDIA, "<CommonAppData>", szCommonAppDataFolder);
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.
why you don´t use "commonappdata" (IS)variable?