|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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! |
|
#3
|
|||
|
|||
|
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'. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
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.








Linear Mode

