View Full Version : install folder
brianlesker
09-29-2004, 04:02 AM
Can somebody provide me some codescripting how i can make my setup only chose LOCAL drives, not network neighborhood etc.
JXBURNS
09-29-2004, 04:14 AM
Assume DRIVE.GETTYPE does not work?
If not there are some API calls you may want to try but I suspect SUF7 is already using those in the DRIVE. commands.
John
brianlesker
09-29-2004, 04:27 AM
Jup that was what i'm searching for, i'm new into SF7 :)
I want to make a NOT structure, what is a good code for it:
if (strTypeDrive != 3) then < doesn't work
if (strTypeDrive <> 3) then < nether
JXBURNS
09-29-2004, 04:51 AM
Remember that DRIVE.TYPE returns a number not a string.
So you could use something like:
drivetype = Drive.GetType("M:");
-- Check if drive type NOT a fixed drive
if (drivetype ~= DRIVE_FIXED) then
...
I would suggest you look at the excellent examples available on most of the Help screens and also the Expressions and Operators help subject.
Rgds John
brianlesker
09-29-2004, 05:17 AM
well i looked @ the help and examples, but didn't find it :)
But fenks for your help!!!!
JXBURNS
09-29-2004, 05:30 AM
A) Click the ADD ACTION.
Select DRIVE.GETTYPE.
Click HELP
Help screen appears.
Click the EXAMPLES tab just below the title line.
B) Click SEARCH
Enter "expression" (without ") as the search
3rd option down shows the Expressions and Operators help.
John
Hi brianlesker,
If you are trying to do this for a Select Drive screen then there is an easy way for you to enable this.
look on the On Preload code for this screen and find the following section:
-- from _SUF70_Global_Functions.lua:
-- fill a table with all fixed and remote drives
tbDrives = g_GetDriveLetters(DRIVE_FIXED, DRIVE_REMOTE);
Here is the description of g_GetDriveLetters from _SUF70_Global_Functions.lua:
--[[
************************************************** ********
Function: g_GetDriveLetters
Purpose: Fills a table with the drive letters (e.g. 'C:') for all of the drives
that match a specific list of drive types, or for all of the drives on
the system if no list of drive types is specified.
Arguments: Call this function with the list of drive types you want to include
in the table, e.g. g_GetTableOfDriveLetters(DRIVE_FIXED, DRIVE_REMOTE)
Returns: (table) A numerically indexed table of drive letters.
************************************************** *********
--]]
So if you wanted to use this screen, but you only wanted it to show local hard drives simply change the code to read:
tbDrives = g_GetDriveLetters(DRIVE_FIXED);
Note: Take a look at the help file for Drive.GetType() for a list of possible values to pass to g_GetDriveLetters();
JXBURNS
09-29-2004, 11:12 AM
Mark - Better example than mine of course - John
brianlesker
10-01-2004, 02:08 AM
PreLoad:
-- These actions are performed before the screen is shown.
-- calculate the amount of space required for the installation
_SpaceRequired = SetupData.CalculateRequiredSpace();
-- format it as a string with an appropriate unit of measurement (e.g. "0 bytes")
local strSpaceRequired = String.GetFormattedSize(_SpaceRequired);
-- store the string in a session variable so it can be used in the screen text
SessionVar.Set("%SpaceRequired%", strSpaceRequired);
-- from _SUF70_Global_Functions.lua:
-- update the 'Space required:' message (expands any session variables in it)
g_UpdateStaticTextCtrl(CTRL_STATICTEXT_SPACEREQUIR ED, "IDS_CTRL_STATICTEXT_SPACEREQUIRED");
-- These actions are performed before the screen is shown.
-- calculate the amount of space required for the installation
_SpaceRequired = SetupData.CalculateRequiredSpace();
-- format it as a string with an appropriate unit of measurement (e.g. "0 bytes")
local strSpaceRequired = String.GetFormattedSize(_SpaceRequired);
-- store the string in a session variable so it can be used in the screen text
SessionVar.Set("%SpaceRequired%", strSpaceRequired);
-- from _SUF70_Global_Functions.lua:
-- update the 'Space required:' message (expands any session variables in it)
g_UpdateStaticTextCtrl(CTRL_STATICTEXT_SPACEREQUIR ED, "IDS_CTRL_STATICTEXT_SPACEREQUIRED");
Don't find:
tbDrives ...??
Maybe i'm to stupid to get it? :wow
csd214
10-01-2004, 03:18 AM
Maybe i'm to stupid to get it?
I don't think so. (I know the feeling of being stupid.) I had to dig a bit, like you I viewed a wrong screen (Select Install Folder). Mark talked about the 'Select Drive' screen. You'll find the statement on line 40 (On Preload).
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.