Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Posts
    4

    Grin Counter-Strike Source Addon Script Help!


    I am making an addon for the popular online game counter-strike source.

    I need the %AppDirectory% to change based on the users installation. The game in installed in a directory based on the users account name.

    It looks something like this:
    C:\Program Files\Valve\Steam\SteamApps\blah@12345.com\counter-strike source

    I need the %AppDirectory% to change and i need a script that will find this folder and set it to the %AppDirectory%.

    I have been trying to get the examples here to work, but i have been unsuccessful.

    I would appreicate any help if possible.
    Thanks in advance!
    Attached Images

  2. #2
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    First you will need to find that path on the users system. The registry is the easiest way (Registry.GetValue()) but this requires the registry key to always exist. The next way I guess is File.Find(). You can give it priority paths to start from.

    Once you have the value in question setting the %AppFolder% is a one line action: SessionVar.Set("%AppFolder%",path to folder);

    I hope this helps

    Adam Kapilik

  3. #3
    Join Date
    Mar 2006
    Posts
    4
    Quote Originally Posted by Adam
    First you will need to find that path on the users system. The registry is the easiest way (Registry.GetValue()) but this requires the registry key to always exist. The next way I guess is File.Find(). You can give it priority paths to start from.

    Once you have the value in question setting the %AppFolder% is a one line action: SessionVar.Set("%AppFolder%",path to folder);

    I hope this helps

    Adam Kapilik
    Well i know nothign about this scripting language. therefore i really can just wrie something up on my own.

    I tried searching the registry, but i cant find a refrence to that folder anywhere in the registery.

    edit: btw thanks for your help!

  4. #4
    Join Date
    Mar 2006
    Posts
    4
    This is the last setp in making my setup package complete! Please help!

  5. #5
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    There is a scripting guide available from Here that can help with the scripting. The File.Find() action can be set up in the actions editor. Here is a small sample script that does not include the guts of the File.Find action but does show the framework that you can work from:

    Code:
    FileFound = File.Find("C:\\MyDir\\", "*.pdf", false, false, nil, nil);
    if FileFound ~= nil then
    	-- A file was found that matched your search criteria
    	-- But the File.Find() returns the full path to the
    	-- file but you onlu want the folder
    	Paths = String.SplitPath(FileFound[1]);
    	-- set %AppFolder% to the drive and folder
    	SessionVar.Set("%AppFolder%",Paths.Drive..Paths.Folder);
    else
    	-- the file was not found. Handle this case however you plan to
    end
    You should perform this early in the setup process. Also note that you should remove the "Select Install Folder" screen since it will overwrite %AppFolder%

    Adam Kapilik

Similar Threads

  1. .NET 1.1 Dependency Script Questions
    By drpepper in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-03-2006, 02:04 PM
  2. Script Editor Pane?
    By rraisley in forum AutoPlay Media Studio 6.0
    Replies: 18
    Last Post: 09-23-2005, 04:08 AM
  3. How can I know the FS Command name of a movie???
    By yoske in forum AutoPlay Media Studio 5.0
    Replies: 27
    Last Post: 01-01-2005, 10:39 PM
  4. Help on "CharacterSet" settings in source script...
    By pixel-kraft in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 03-06-2004, 04:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts