PDA

View Full Version : Folder Questions



Arun2
10-17-2011, 08:04 AM
Question 1: I am using Get Special Folder (CSIDL_APPDATA ) which returns me ( C:\Documents and Settings\[my login name]\ )

My question is how do I get the parent folder's full path (in this case answer should be (C:\Documents and Settings)?


Question 2: I am using Setupbuilder 7.1. Will "Handle File Listing" give me a list of files and folders?

I specifically want to traverse through all folders in a particular directory.

Would appreciate any help on this, Thanks.

linder
10-17-2011, 08:29 AM
Hello,

Support for SetupBuilder 7.1 came to an end last year on July 26, 2010, so my answers are based on the latest SetupBuilder 7.5.

Answer 1:

You can use Handle String Operation (Extract Root Folder) to retrieve the root. For example:

Set Variable %TEST% to FUNCTION:Get Special Folder("CSIDL_APPDATA")
Set Variable %ROOT% to FUNCTION:Extract Root Folder(%TEST%)

Question 2:

The "Handle File Listing" function lets you retrieve a list of files (but not folders).

Does this help?

Friedrich

Arun2
10-17-2011, 09:05 AM
Thanks for your prompt reply! It does help.

So, since I do not have acess to "Extract Root" (since I am using 7.1), I tried
getting the parent folder by using :

FULLFOLDERPATH=C:\Documents And Settings\Administrator

Set Variable %LASTFOLDERPATH% and %REST% to FUNCTION:Split Source String at Last Occurrence of Search String(%FULLFOLDERPATH%, "\")

This returns:

LASTFOLDERPATH=C:\Documents And Settings

--

Is that a good strategy? Do you anticipate any problems with this?

Thanks,
-Arun

linder
10-17-2011, 09:30 AM
On UAC-aware systems, the AppData looks like this:

C:\Users\arun.shah\AppData\Roaming

Your code would retrieve "C:\Users\arun.shah\AppData"

In other words, your idea might work on XP but not on modern operating systems.

Hope this helps.

Friedrich