Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    SUF6NEWBIE Guest

    Example: Accessing a system resource

    Just a bit of code to show an example of how to use a known
    system resource to do a bit of work for you.

    Note: this particular one requires Windows XP or later OSs
    (there is obviously no error handling code...)

    Code:
    function GetSystemInfo() --get system info to a usable string (for XP or later OSs only)
    
    	--first create the cmd file to run the system resource "system32\systeminfo.exe"
    	--and output the results, when run,  to a textfile.
    
    	TextFile.WriteFromString(_TempLaunchFolder.."\\~SysInfo.cmd", "@ECHO OFF\r\nTITLE  wait one..."
    	.."\r\nsysteminfo >".." ".._TempLaunchFolder.."\\~sysinfo.dat\r\nExit", false);
    	File.Run(_TempLaunchFolder.."\\~SysInfo.cmd", "", "", SW_MINIMIZE, true);
    	local strSysInfo = TextFile.ReadToString(_TempLaunchFolder.."\\~sysinfo.dat");
    	File.Delete(_TempLaunchFolder.."\\~SysInfo.*", false, false, true, nil); --cleanup
    	return strSysInfo;
    end
    
    --add below code to call at any time during setup eg: startup actions
    --as long as is called before the Target Screen is next in Runtime Sequence
    --to display information simply place %SysInfo% eg: in scrolling text screen
    --(the main body - using edit screen)
    
    SessionVar.Set("%SysInfo%",GetSystemInfo());
    Last edited by SUF6NEWBIE; 10-21-2004 at 02:23 AM.

  2. #2
    Join Date
    Oct 2003
    Posts
    908
    Quick note: To make your script or function snippets appear in that neat scrolling box and maintain your tabs etc, simply enclose your section of text with [ code ] and [ /code ].

    (Remove the extra spaces inside the square brackets...)

    Here is list of all vB code tags that you can use to format your messages:

    http://www.indigorose.com/forums/misc.php?do=bbcode

  3. #3
    SUF6NEWBIE Guest
    Thankyou TED,

    in addition to the (now better formatted !) example code,
    if end up using this one for any purpose and you have
    included 'uninstall support' for your created 'setup.exe,

    session variables are expanded in the created 'uninstall.xml'
    file during the install routine. So if you do not wish the
    %SysInfo% information to be included in the .xml file
    (easily viewable from 'wordpad' by end user) , then could place:

    SessionVar.Remove("%SysInfo%");

    in for example, by selecting Actions Tab, then 'on Pre Install'.

Similar Threads

  1. KB: Determining the Operating System (OS)
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 1
    Last Post: 01-25-2005, 10:41 AM
  2. Press Release: Indigo Rose Launches New Online Support System
    By Colin in forum Announcements & News
    Replies: 0
    Last Post: 02-02-2004, 03:51 PM
  3. INFO: Changing the Resource Information for a Setup.exe
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 02:09 PM
  4. INFO: Changing the Resource Information for a Setup.exe
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-15-2002, 02:09 PM
  5. HOWTO: Make a Program Run Every Time the System Starts
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-01-2002, 09:44 AM

Posting Permissions

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