home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / SB307 / SETUP.INF < prev    next >
Text File  |  1995-02-22  |  8KB  |  231 lines

  1. //
  2. // Setup Installation File
  3. // Created by Setup Builder Version Setup Builder
  4. //
  5. // Copyright 1993, 1994 G.Plowman
  6. //
  7. // Created: 22-02-1995 at 20:33:14
  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"
  19. SET %InstallPath%="C:\SETUP"
  20. SET %InstallDrive%="C:"
  21. SET %IniFile%="BUILDER.INI"
  22.  
  23.  
  24. // User defined code - initialisation
  25. GetProfileString("Install", "Path", "%InstallPath%", "%IniFile%", %InstallPath%)
  26.  
  27.  
  28. // Welcome Dialog
  29. SET %Message1%="Welcome to the %Application% Installation Program."
  30. SET %Message2%="This program will install the %Application% software in the directory you specify or it will remove the software from your hard disk."
  31. DialogBox("Welcome")
  32. IF %ERROR% == IDCANCEL GOTO :EXIT
  33.  
  34.  
  35. // De-Installation option
  36. :BACK
  37. SET %PUSHB_1%="&Install"
  38. SET %Message1%="Install the %Application% software"
  39. SET %PUSHB_2%="&De-Install"
  40. SET %Message2%="De-Install the %Application% software"
  41. DialogBox("PUSHB2")
  42. IF %ERROR%==IDCANCEL GOTO :EXIT
  43. IF %ERROR%==IDBUTTON2 GOTO :DEINSTALL
  44.  
  45.  
  46. // Ask the user where to install the software
  47. :RETRY
  48. SET %Message1%="The install program will copy the %Application% files into the following directory:"
  49. DialogBox("AskPath")
  50. IF %ERROR% == IDBACK GOTO :BACK
  51. IF %ERROR% == IDCANCEL GOTO :EXIT
  52.  
  53.  
  54. // User defined code - pre file copying
  55. // Save the install directory
  56. WriteProfileString("Install", "Path", "%InstallPath%", "%IniFile%")
  57. WriteProfileString("Install", "Version", "3.07", "%IniFile%")
  58.  
  59. // Make the temporary directory
  60. MkDir("%WindowsDirectory%TEMP")
  61. WriteProfileString("Install", "TempPath", "%WindowsDirectory%TEMP", "%IniFile%")
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. // Make sure we still have Disk #01 in the drive
  69. CheckExists("%CurrentDrive%DISK01", "Please insert the diskette labelled 'DISK01'")
  70. IF %ERROR% == IDCANCEL GOTO :EXIT
  71.  
  72.  
  73. // Copy files from disk & show in gauge - no usage or overwrite check
  74. CopyFile(12)
  75. "SETUP.EXE", "%InstallPath%", "Copying: Interpreter Executable"
  76. "INST.EXE", "%InstallPath%", "Copying: Interpreter Executable"
  77. "BUILDER.EXE", "%InstallPath%", "Copying: Setup Builder Executable"
  78. "BUILDER.HLP", "%InstallPath%", "Copying: Setup Builder Help File"
  79. "SETUP.HLP", "%InstallPath%", "Copying: Setup Help File"
  80. "DOSEXEC.PIF", "%WindowsDirectory%", "Copying: PIF File"
  81. "LADMIN.EXE", "%InstallPath%", "Copying: License Administration Utility"
  82. "INVOICE.TXT", "%InstallPath%", "Copying: Supporting Documentation"
  83. "COMMENTS.TXT", "%InstallPath%", "Copying: Supporting Documentation"
  84. "INSTALL.TXT", "%InstallPath%", "Copying: Supporting Documentation"
  85. "README.TXT", "%InstallPath%", "Copying: Supporting Documentation"
  86. "SETUP.SPJ", "%InstallPath%", "Copying: Sample Setup Project"
  87.  
  88.  
  89.  
  90.  
  91. // Now copy files which require a module usage
  92. // check or overwrite confirmation
  93. CheckExists("%SystemDirectory%CTL3DV2.DLL")
  94. IF %ERROR% == TRUE GOTO :PRESENT1
  95. GOTO :COPY1
  96. :PRESENT1
  97. GetFileDate("CTL3DV2.DLL",%SDate%)
  98. GetFileTime("CTL3DV2.DLL",%STime%)
  99. GetFileLength("CTL3DV2.DLL")
  100. SET %SLen%=%ERROR%
  101. GetFileDate("%SystemDirectory%CTL3DV2.DLL",%DDate%)
  102. GetFileTime("%SystemDirectory%CTL3DV2.DLL",%DTime%)
  103. GetFileLength("%SystemDirectory%CTL3DV2.DLL")
  104. SET %DLen%=%ERROR%
  105. MessageBox("Setup is attempting to overwrite:||%SystemDirectory%CTL3DV2.DLL|(%SDate% %STime% %SLen% Bytes)||with:||%CurrentDrive%\CTL3DV2.DLL|(%DDate% %DTime% %DLen% Bytes)||Are you sure you wish to overwrite this file ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  106. IF %ERROR% == IDNO GOTO :NOCOPY1
  107. :COPY1
  108. CopyFile("CTL3DV2.DLL", "%SystemDirectory%")
  109. :NOCOPY1
  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("License Administrator", "%InstallPath%LADMIN.EXE %IniFile%")
  120. MakeIcon("Install", "A:\SETUP.EXE")
  121. MakeIcon("Setup Script Help", "WINHELP %InstallPath%SETUP.HLP")
  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.  
  142.  
  143. IF "%IniFile%" == "" SET %IniFile%="Setup.INI"
  144. SET %Message1% = "Please enter the following licensing information for the %Application% software:"
  145. DialogBox("License")
  146. IF %ERROR% == IDCANCEL GOTO :EXIT
  147.  
  148.  
  149. // Done
  150. SET %Message1%="|%Application% installation has been successfully completed."
  151. SET %Message2%=""
  152. DialogBox("OkBox")
  153.  
  154.  
  155. // User defined code - installation completion
  156. MessageBox("Do you wish to view the|extra installation notes ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  157. IF %ERROR% == IDNO GOTO :NONOTES
  158.  
  159. ChDir("%InstallPath%")
  160. WinExec("notepad.exe %InstallPath%README.TXT")
  161. :NONOTES
  162.  
  163. GOTO :END
  164.  
  165.  
  166. // User decided to quit
  167. :EXIT
  168. SET %Message1%="Installation has been terminated. You should rerun this installation program at a later time to install %Application%."
  169. SET %Message2%="|The %Application% software has not been installed."
  170. DialogBox("OkBox")
  171. GOTO :END
  172.  
  173.  
  174. // Error
  175. :ERROR
  176. SET %Message1%="An error occured during installation of the %Application% software."
  177. SET %Message2%="|The %Application% software has not been fully installed."
  178. DialogBox("OkBox")
  179. GOTO :END
  180.  
  181.  
  182. // Not enough disk space
  183. :NOSPACE
  184. SET %Message1% = "|There is not enough space on the selected drive to install the %Application% software."
  185. SET %Message2% = ""
  186. DialogBox("OkBox")
  187. GOTO :RETRY
  188.  
  189.  
  190. // User defined code - De-Installation option
  191. :DEINSTALL
  192. // Check to see if the software has been installed correctly
  193. GetProfileString("Install", "Path", "", "%IniFile%", %InstallPath%)
  194.  
  195. IF "%InstallPath%" == "" GOTO :NOTINSTALLED
  196.  
  197. // Software has been installed
  198. 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)
  199. IF %ERROR% == IDYES GOTO :DODELETE
  200. SET %Message1% = "De-installation aborted - the %Application% software has not been deinstalled."
  201. SET %Message2% = ""
  202. DialogBox("OKBOX")
  203. GOTO :END
  204.  
  205. :DODELETE
  206. Delete("%InstallPath%*.*")
  207. SET %Len% = Len("%InstallPath%") - 1
  208. SET %InstallPath% = Left("%InstallPath%", %Len%)
  209. RmDir("%InstallPath%")
  210. Delete("%WindowsDirectory%%IniFile%")
  211. Delete("%WindowsDirectory%COMPRESS.EXE")
  212. Delete("%WindowsDirectory%COMPRESS.TXT")
  213. DeleteGroup("%Application%")
  214.  
  215. // Finally file manager item
  216. WriteProfileString("Extensions", "inf", "", "WIN.INI")
  217.  
  218. SET %Message1% = "The %Application% software has been successfully de-installed."
  219. SET %Message2% = "To re-install the %Application% software you should re-run this installation program."
  220. DialogBox("OKBOX")
  221. GOTO :END
  222.  
  223. :NOTINSTALLED
  224. SET %Message1% = "The %Application% software has not been correctly installed."
  225. SET %Message2% = "The De-installation procedure is unable to de-install the %Application% software."
  226. DialogBox("OKBOX")
  227. GOTO :END
  228.  
  229.  
  230. :END
  231.