home *** CD-ROM | disk | FTP | other *** search
/ Chip Hitware 2 / Chip_Hitware_Vol_02.iso / chiphit2 / tools / desktop / setup_b / setup.inf < prev    next >
Text File  |  1995-06-18  |  8KB  |  240 lines

  1. //
  2. // Setup Installation File
  3. // Created by Setup Builder Version 3.08
  4. //
  5. // Copyright 1993, 1994 G.Plowman
  6. //
  7. // Created: 17-06-1995 at 10:37:24
  8. //
  9. //
  10. // Setup procedure for installing/de-installing:
  11. //
  12. // SETUP / SETUP BUILDER
  13. //
  14.  
  15.  
  16. // Application Variables
  17. SET %Caption%="Setup"
  18. SET %Application%="Setup Builder"
  19. SET %InstallPath%="C:\SETUP"
  20. SET %InstallDrive%="C:"
  21. SET %IniFile%="BUILDER.INI"
  22.  
  23.  
  24. // Set up the backdrop text
  25. SetBackdropText(1, "|    Setup Builder Installation", 1, 1, 50, 255, 255, 255)
  26. SetBackdropText(2, "    Install created using Setup Builder Version 3.08|    Copyright (c) 1993, 1994, 1995 G.Plowman|", 0, 1, 17, 255, 255, 255)
  27.  
  28.  
  29. // Now display the appropriate backdrop
  30. GetScreenWidth(%Width%)
  31. IF %Width% == 640 ShowBackDrop("", 0, 0, 0)
  32. IF %Width% == 640 GOTO :DONEBACKDROP
  33. IF %Width% == 800 ShowBackDrop("", 0, 0, 0)
  34. IF %Width% == 800 GOTO :DONEBACKDROP
  35. IF %Width% == 1024 ShowBackDrop("", 0, 0, 0)
  36. IF %Width% == 1024 GOTO :DONEBACKDROP
  37.  
  38. // Display default backdrop if screen size not recognised
  39. ShowBackDrop("", 0, 0, 0)
  40. :DONEBACKDROP
  41.  
  42.  
  43. // User defined code - initialisation
  44. GetProfileString("Install", "Path", "%InstallPath%", "%IniFile%", %InstallPath%)
  45.  
  46.  
  47. // Welcome Dialog
  48. SET %Message1%="Welcome to the %Application% Installation Program."
  49. SET %Message2%="This program will install the %Application% software in the directory you specify or it will remove the software from your hard disk."
  50. DialogBox("Welcome")
  51. IF %ERROR% == IDCANCEL GOTO :EXIT
  52.  
  53.  
  54. // De-Installation option
  55. :BACK
  56. SET %PUSHB_1%="&Install"
  57. SET %Message1%="Install the %Application% software"
  58. SET %PUSHB_2%="&De-Install"
  59. SET %Message2%="De-Install the %Application% software"
  60. DialogBox("PUSHB2")
  61. IF %ERROR%==IDCANCEL GOTO :EXIT
  62. IF %ERROR%==IDBUTTON2 GOTO :DEINSTALL
  63.  
  64.  
  65. // Ask the user where to install the software
  66. :RETRY
  67. SET %Message1%="The install program will copy the %Application% files into the following directory:"
  68. DialogBox("AskPath")
  69. IF %ERROR% == IDBACK GOTO :BACK
  70. IF %ERROR% == IDCANCEL GOTO :EXIT
  71.  
  72.  
  73. // User defined code - pre file copying
  74. // Save the install directory
  75. WriteProfileString("Install", "Path", "%InstallPath%", "%IniFile%")
  76. WriteProfileString("Install", "Version", "3.08", "%IniFile%")
  77.  
  78. // Make the temporary directory
  79. MkDir("%WindowsDirectory%TEMP")
  80. WriteProfileString("Install", "TempPath", "%WindowsDirectory%TEMP", "%IniFile%")
  81.  
  82. // Create an extra directory
  83. MkDir("%InstallPath%SAMPLES")
  84.  
  85.  
  86.  
  87.  
  88.  
  89. // Make sure we have Disk #1 in the drive
  90. CheckExists("%CurrentDrive%DISK01", "Please insert the diskette labelled 'DISK01'")
  91. IF %ERROR% == IDCANCEL GOTO :EXIT
  92.  
  93.  
  94. // Copy files from disk & show in gauge - no usage or overwrite check
  95. CopyFile(14)
  96. "SETUP.EXE", "%InstallPath%", "Copying: Interpreter Executable", TRUE
  97. "INST.EXE", "%InstallPath%", "Copying: Interpreter Executable", TRUE
  98. "BUILDER.EXE", "%InstallPath%", "Copying: Setup Builder Executable", TRUE
  99. "BUILDER.HLP", "%InstallPath%", "Copying: Setup Builder Help File", TRUE
  100. "SETUP.HLP", "%InstallPath%", "Copying: Setup Script Language Help File", TRUE
  101. "DOSEXEC.PIF", "%WindowsDirectory%", "Copying: PIF File", TRUE
  102. "DIBAPI.DLL", "%InstallPath%", "Copying: Dynamic Link Library", TRUE
  103. "LADMIN.EXE", "%InstallPath%", "Copying: License Administration Utility", TRUE
  104. "INVOICE.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  105. "COMMENTS.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  106. "INSTALL.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  107. "README.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  108. "SETUP.SPJ", "%InstallPath%SAMPLES", "Copying: Sample Setup Project", TRUE
  109. "SETUP.INF", "%InstallPath%SAMPLES", "Copying: Sample Setup Project", TRUE
  110.  
  111.  
  112.  
  113.  
  114. // User defined code - post file copying
  115. // Make the Program Manager Group and icons
  116. MakeGroup("%Application%", "")
  117. MakeIcon("Setup Builder", "%InstallPath%BUILDER.EXE")
  118. MakeIcon("Setup Builder Help", "WINHELP %InstallPath%BUILDER.HLP")
  119. MakeIcon("Setup Script Help", "WINHELP %InstallPath%SETUP.HLP")
  120. MakeIcon("License Administrator", "%InstallPath%LADMIN.EXE %IniFile%")
  121. MakeIcon("Install", "A:\SETUP.EXE")
  122. MakeIcon("ReadMe", "notepad %InstallPath%README.TXT")
  123. MakeIcon("Install Notes", "notepad %InstallPath%INSTALL.TXT")
  124.  
  125. // File association
  126. MessageBox("Setup can install a file association|for File Manager with .INF files.||Do you wish to install this association ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  127. IF %ERROR% == IDNO GOTO :NOASSOC
  128. WriteProfileString("Extensions", "inf", "%InstallPath%inst.exe ^.inf", "WIN.INI")
  129. :NOASSOC
  130.  
  131. // License
  132. GetProfileString("License", "Registration", "", "%IniFile%", %LStr%)
  133. IF "%LStr%" != "" GOTO :GOTIT
  134. GetLicense(%License%)
  135. WriteProfileString("License", "Registration", "%License%", "%IniFile%")
  136. :GOTIT
  137.  
  138. // Tell Setup Builder where to find some files for creating install disks
  139. WriteProfileString("Executables", "Setup", "%InstallPath%setup.exe", "%IniFile%")
  140. WriteProfileString("Executables", "Inst", "%InstallPath%inst.exe", "%IniFile%")
  141. WriteProfileString("Executables", "DibAPI", "%InstallPath%dibapi.dll", "%IniFile%")
  142.  
  143.  
  144. // Licensing
  145. :LICENSING
  146. IF "%IniFile%" == "" SET %IniFile%="Setup Builder.INI"
  147. SET %Message1% = "Please enter the following licensing information for the %Application% software:"
  148. DialogBox("License")
  149. IF %ERROR% == IDCANCEL GOTO :EXIT
  150.  
  151.  
  152. // Done
  153. :SUCCESS
  154. SET %Message1%="|%Application% installation has been successfully completed."
  155. SET %Message2%=""
  156. DialogBox("OkBox")
  157.  
  158.  
  159. // User defined code - installation completion
  160. MessageBox("Do you wish to view the|extra installation notes ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  161. IF %ERROR% == IDNO GOTO :NONOTES
  162.  
  163. ChDir("%InstallPath%")
  164. WinExec("notepad.exe %InstallPath%README.TXT")
  165. :NONOTES
  166.  
  167. GOTO :END
  168.  
  169.  
  170. // User decided to quit
  171. :EXIT
  172. SET %Message1%="Installation has been terminated. You should rerun this installation program at a later time to install %Application%."
  173. SET %Message2%="|The %Application% software has not been installed."
  174. DialogBox("OkBox")
  175. GOTO :END
  176.  
  177.  
  178. // Error
  179. :ERROR
  180. SET %Message1%="An error occured during installation of the %Application% software."
  181. SET %Message2%="|The %Application% software has not been fully installed."
  182. DialogBox("OkBox")
  183. GOTO :END
  184.  
  185.  
  186. // Not enough disk space
  187. :NOSPACE
  188. SET %Message1% = "|There is not enough space on the selected drive to install the %Application% software."
  189. SET %Message2% = ""
  190. DialogBox("OkBox")
  191. GOTO :RETRY
  192.  
  193.  
  194. // User defined code - De-Installation option
  195. :DEINSTALL
  196. // Change the backdrop message
  197. SetBackDropText(1, "|    Setup Builder De-Installation", TRUE, TRUE)
  198. ShowBackdrop("", FALSE, TRUE, FALSE)
  199.  
  200. // Check to see if the software has been installed correctly
  201. GetProfileString("Install", "Path", "", "%IniFile%", %InstallPath%)
  202. IF "%InstallPath%" == "" GOTO :NOTINSTALLED
  203.  
  204. // Software has been installed
  205. MessageBox("The %Application% software is about to be removed from your machine.||All files, directories and the appropriate Program Manager Group will be deleted.||Are you sure you wish to continue ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  206. IF %ERROR% == IDYES GOTO :DODELETE
  207. SET %Message1% = "De-installation aborted - the %Application% software has not been deinstalled."
  208. SET %Message2% = ""
  209. DialogBox("OKBOX")
  210. GOTO :END
  211.  
  212. :DODELETE
  213. Delete("%InstallPath%SAMPLES\*.*")
  214. Delete("%InstallPath%*.*")
  215. RmDir("%InstallPath%SAMPLES")
  216. SET %Len% = Len("%InstallPath%") - 1
  217. SET %InstallPath% = Left("%InstallPath%", %Len%)
  218. RmDir("%InstallPath%")
  219. Delete("%WindowsDirectory%%IniFile%")
  220. Delete("%WindowsDirectory%COMPRESS.EXE")
  221. Delete("%WindowsDirectory%COMPRESS.TXT")
  222. DeleteGroup("%Application%")
  223.  
  224. // Finally file manager item
  225. WriteProfileString("Extensions", "inf", "", "WIN.INI")
  226.  
  227. SET %Message1% = "The %Application% software has been successfully de-installed."
  228. SET %Message2% = "To re-install the %Application% software you should re-run this installation program."
  229. DialogBox("OKBOX")
  230. GOTO :END
  231.  
  232. :NOTINSTALLED
  233. SET %Message1% = "The %Application% software has not been correctly installed."
  234. SET %Message2% = "The De-installation procedure is unable to de-install the %Application% software."
  235. DialogBox("OKBOX")
  236. GOTO :END
  237.  
  238.  
  239. :END
  240.