Indigo Rose Software
  #1  
Old 10-21-2004
SUF6NEWBIE
Guest
 
Posts: n/a
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 03:23 AM.
Reply With Quote
  #2  
Old 10-21-2004
Ted Sullivan's Avatar
Ted Sullivan Ted Sullivan is offline
Indigo Rose Staff Member
 
Join Date: Oct 2003
Posts: 825
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
__________________
Check out the new MSI Factory 2.0!
Reply With Quote
  #3  
Old 10-22-2004
SUF6NEWBIE
Guest
 
Posts: n/a
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'.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


All times are GMT -6. The time now is 03:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software