home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1998 January / PCShareware-1-98.bin / programy / setupb / sample3.scr < prev    next >
Text File  |  1996-08-03  |  3KB  |  101 lines

  1.  
  2. // SAMPLE3.INF
  3.  
  4. // Setup Builder sample support file
  5.  
  6. // Copyright 1993 - 1996 Graham Plowman
  7.  
  8.  
  9. // This sample demonstrates how the INST16.EXE module
  10. // supplied with Setup Builder can be used as a
  11. // generic script interpreter for adding little
  12. // 'programs' on to Windows.
  13.  
  14. // This demonstration causes a dialog to appear
  15. // from which you can select some programs to run.
  16. // You need to place SAMPLE3.INI in your WINDOWS
  17. // directory.
  18. // You can attach this script file to a Program
  19. // Manager icon in your StartUp group. In that way,
  20. // when you start Windows, you can optionally select
  21. // which programs you want to run.
  22. // By default, the .INI file has been set up to run
  23. // notepad, cardfile, clock and the calculator, but
  24. // you can change this to any program you like.
  25.  
  26. // This small utility is useful if you want to
  27. // 'quickly' start up Windows on your machine and not
  28. // run all the items in your startup group: you simply
  29. // code them into SAMPLE3.INI instead of the StartUp
  30. // group and select the ones you want to run.
  31.  
  32.  
  33. Set %Caption% = "Auto Program Run"
  34. Set %IniFile% = "SAMPLE3.INI"
  35.  
  36. GetProfileString("Values", "Sel1", "0", %IniFile%, %BUTTON1%)
  37. GetProfileString("Values", "Msg1", "", %IniFile%, %MESSAGE1%)
  38.  
  39. GetProfileString("Values", "Sel2", "0", %IniFile%, %BUTTON2%)
  40. GetProfileString("Values", "Msg2", "", %IniFile%, %MESSAGE2%)
  41.  
  42. GetProfileString("Values", "Sel3", "0", %IniFile%, %BUTTON3%)
  43. GetProfileString("Values", "Msg3", "", %IniFile%, %MESSAGE3%)
  44.  
  45. GetProfileString("Values", "Sel4", "0", %IniFile%, %BUTTON4%)
  46. GetProfileString("Values", "Msg4", "", %IniFile%, %MESSAGE4%)
  47.  
  48. GetProfileString("Values", "Sel5", "0", %IniFile%, %BUTTON5%)
  49. GetProfileString("Values", "Msg5", "", %IniFile%, %MESSAGE5%)
  50.  
  51. GetProfileString("Values", "Sel6", "0", %IniFile%, %BUTTON6%)
  52. GetProfileString("Values", "Msg6", "", %IniFile%, %MESSAGE6%)
  53.  
  54. DialogBox("CHECKBOX6")
  55. IF %ERROR% == IDCANCEL GOTO :END
  56.  
  57.  
  58. // Save all the selections for next time
  59.  
  60. WriteProfileString("Values", "Sel1", %BUTTON1%, %IniFile%)
  61. WriteProfileString("Values", "Sel2", %BUTTON2%, %IniFile%)
  62. WriteProfileString("Values", "Sel3", %BUTTON3%, %IniFile%)
  63. WriteProfileString("Values", "Sel4", %BUTTON4%, %IniFile%)
  64. WriteProfileString("Values", "Sel5", %BUTTON5%, %IniFile%)
  65. WriteProfileString("Values", "Sel6", %BUTTON6%, %IniFile%)
  66.  
  67.  
  68. // Run the selected programs
  69.  
  70. IF %BUTTON1% == 0 GOTO :NOPROG1
  71. GetProfileString("Values", "Prog1", "", %IniFile%, %Prog%)
  72. WinExec(%Prog%)
  73. :NOPROG1
  74.  
  75. IF %BUTTON2% == 0 GOTO :NOPROG2
  76. GetProfileString("Values", "Prog2", "", %IniFile%, %Prog%)
  77. WinExec(%Prog%)
  78. :NOPROG2
  79.  
  80. IF %BUTTON3% == 0 GOTO :NOPROG3
  81. GetProfileString("Values", "Prog3", "", %IniFile%, %Prog%)
  82. WinExec(%Prog%)
  83. :NOPROG3
  84.  
  85. IF %BUTTON4% == 0 GOTO :NOPROG4
  86. GetProfileString("Values", "Prog4", "", %IniFile%, %Prog%)
  87. WinExec(%Prog%)
  88. :NOPROG4
  89.  
  90. IF %BUTTON5% == 0 GOTO :NOPROG5
  91. GetProfileString("Values", "Prog5", "", %IniFile%, %Prog%)
  92. WinExec(%Prog%)
  93. :NOPROG5
  94.  
  95. IF %BUTTON6% == 0 GOTO :NOPROG6
  96. GetProfileString("Values", "Prog6", "", %IniFile%, %Prog%)
  97. WinExec(%Prog%)
  98. :NOPROG6
  99.  
  100. :END
  101.