Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

How do I get the 'Program Files' directory within WiseScript?

Updated: 21 May 2010 | 6 comments
victorcamp's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

I'm using the WiseScript Editor to create a wrapper for a Wise Installation Express 7.0 MSI.
It works great. Now I want to add a search for a particular file on the user's computer, and if it's not there, copy it during the install.

I've checked the list of Automatic Compiler Variables, and the list of Automatic Run-Time Variables, and 'Program Files' isn't in either list.
It is in the list of Run-Time Variables, but if I try to use that, it says it's not been set. How do I set it?

I can't get it from:
  Get System Information - It's not in the list of available info
  Get Windows Installer Properties - WiseScript says I can only use that inside an install

How do I get various Windows directories for use within this wrapper script?

Comments

Scot Curry's picture
11
Jul
2009
2 Votes +2
Login to vote

Program Files Folder

One easy way to get the Program Files folder into your script is to use Get Environment Variable.  There is an environment varialbe called ProgramFiles that will point to that folder.

Hope that helps.  Talk to you soon,
Scot 

cwells@quickverse's picture
22
Oct
2009
0 Votes 0
Login to vote

How about the CSIDL_COMMON_DOCUMENTS folder path?

This CSIDL_COMMON_DOCUMENTS folder is simply the All Users/Documents folder in XP ... or the Public Documents folder in Vista and Win7.  How can I specifically get this CSIDL path?  I can get a path from the registry here:  HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Shell Folders ... but prefer to get an environment variable using the CSIDL (or as it's now known in Vista and Win7 "KNOWNFOLDERID") path?

EdT's picture
22
Oct
2009
0 Votes 0
Login to vote

Is there an environment

Is there an environment variable you can use?
Otherwise, what's the issue with using the registry entry?

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

cwells@quickverse's picture
22
Oct
2009
0 Votes 0
Login to vote

Instead of reading the

Instead of reading the Registry, I now use environment variables as listed on this page:
 
… scroll down to the FOLDERID_PublicDocuments section
 
This is the sample script logic from WiseScript Package Editor:
 
If System Has Windows XP Running then
   Get Environment Variable ALLUSERSPROFILE into Variable PUBLICDOCS
   Set Variable MY_VARIABLE to %PUBLICDOCS%\Documents\My Folder Name
Else
   Get Environment Variable PUBLIC into Variable PUBLICDOCS
   Set Variable MY_VARIABLE to %PUBLICDOCS%\Documents\My Folder Name
End
EdT's picture
23
Oct
2009
0 Votes 0
Login to vote

Thanks for the Microsoft link.

Useful.....

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

victorcamp's picture
11
Jul
2009
0 Votes 0
Login to vote

Re: How do I get the 'Program Files' directory within WiseScript

YES! That does it!

Get Environment Variable ProgramFiles into Variable PROGFILES
Display Message "Program Files Directory"

[which returned "C:\Program Files"]

Thanks Scot

--Victor