Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

362 lines
10 KiB

  1. VERSION 5.00
  2. Begin VB.Form frmExt
  3. BorderStyle = 4 'Fixed ToolWindow
  4. Caption = "Extension Information"
  5. ClientHeight = 5400
  6. ClientLeft = 1770
  7. ClientTop = 1725
  8. ClientWidth = 6135
  9. ControlBox = 0 'False
  10. LinkTopic = "Form1"
  11. LockControls = -1 'True
  12. MaxButton = 0 'False
  13. MinButton = 0 'False
  14. ScaleHeight = 5400
  15. ScaleWidth = 6135
  16. ShowInTaskbar = 0 'False
  17. Begin VB.TextBox txtSourceFolder
  18. Enabled = 0 'False
  19. Height = 315
  20. Left = 1755
  21. TabIndex = 24
  22. TabStop = 0 'False
  23. Top = 2745
  24. Width = 4305
  25. End
  26. Begin VB.TextBox txtExtensionFolder
  27. Height = 315
  28. Left = 1755
  29. TabIndex = 5
  30. Top = 2415
  31. Width = 4305
  32. End
  33. Begin VB.TextBox txtOwner
  34. Height = 315
  35. Left = 1755
  36. TabIndex = 2
  37. Top = 1530
  38. Width = 4305
  39. End
  40. Begin VB.CommandButton cmdCancel
  41. Caption = "&Cancel"
  42. CausesValidation= 0 'False
  43. Height = 420
  44. Left = 4080
  45. TabIndex = 16
  46. Top = 4890
  47. Width = 975
  48. End
  49. Begin VB.CommandButton cmdOK
  50. Caption = "&OK"
  51. Height = 420
  52. Left = 5070
  53. TabIndex = 15
  54. Top = 4890
  55. Width = 975
  56. End
  57. Begin VB.CheckBox chkModifiesCab
  58. Caption = "Executable Modifies Original CAB"
  59. Height = 270
  60. Left = 1755
  61. TabIndex = 4
  62. Top = 2175
  63. Width = 3210
  64. End
  65. Begin VB.TextBox txtExecutable
  66. Height = 315
  67. Left = 1755
  68. TabIndex = 3
  69. Top = 1860
  70. Width = 4305
  71. End
  72. Begin VB.Frame fraSKU
  73. Caption = "SKU"
  74. Height = 1575
  75. Left = 1755
  76. TabIndex = 17
  77. Top = 3165
  78. Width = 4305
  79. Begin VB.CheckBox chkSku
  80. Caption = "32-bit Standard"
  81. Height = 255
  82. Index = 0
  83. Left = 150
  84. TabIndex = 7
  85. Top = 495
  86. Width = 1695
  87. End
  88. Begin VB.CheckBox chkSku
  89. Caption = "32-bit Professional"
  90. Height = 255
  91. Index = 1
  92. Left = 150
  93. TabIndex = 8
  94. Top = 750
  95. Width = 1695
  96. End
  97. Begin VB.CheckBox chkSku
  98. Caption = "32-bit Server"
  99. Height = 255
  100. Index = 2
  101. Left = 1920
  102. TabIndex = 10
  103. Top = 240
  104. Width = 2055
  105. End
  106. Begin VB.CheckBox chkSku
  107. Caption = "32-bit Advanced Server"
  108. Height = 255
  109. Index = 3
  110. Left = 1920
  111. TabIndex = 11
  112. Top = 492
  113. Width = 2055
  114. End
  115. Begin VB.CheckBox chkSku
  116. Caption = "32-bit Datacenter Server"
  117. Height = 255
  118. Index = 4
  119. Left = 1920
  120. TabIndex = 13
  121. Top = 996
  122. Width = 2055
  123. End
  124. Begin VB.CheckBox chkSku
  125. Caption = "64-bit Professional"
  126. Height = 255
  127. Index = 5
  128. Left = 150
  129. TabIndex = 9
  130. Top = 1005
  131. Width = 1695
  132. End
  133. Begin VB.CheckBox chkSku
  134. Caption = "64-bit Advanced Server"
  135. Height = 255
  136. Index = 6
  137. Left = 1920
  138. TabIndex = 12
  139. Top = 744
  140. Width = 2055
  141. End
  142. Begin VB.CheckBox chkSku
  143. Caption = "64-bit Datacenter Server"
  144. Height = 255
  145. Index = 7
  146. Left = 1920
  147. TabIndex = 14
  148. Top = 1245
  149. Width = 2055
  150. End
  151. Begin VB.CheckBox chkSku
  152. Caption = "Windows Me"
  153. Height = 255
  154. Index = 8
  155. Left = 150
  156. TabIndex = 6
  157. Top = 240
  158. Width = 1320
  159. End
  160. End
  161. Begin VB.TextBox Text2
  162. Height = 1095
  163. Left = 1755
  164. MultiLine = -1 'True
  165. TabIndex = 1
  166. Top = 420
  167. Width = 4305
  168. End
  169. Begin VB.TextBox txtDisplayName
  170. Height = 315
  171. Left = 1755
  172. TabIndex = 0
  173. Top = 75
  174. Width = 4305
  175. End
  176. Begin VB.Label Label4
  177. Caption = "Extension copied from:"
  178. Height = 330
  179. Left = 105
  180. TabIndex = 23
  181. Top = 2745
  182. Width = 1725
  183. End
  184. Begin VB.Label Label5
  185. Caption = "Extension copied to:"
  186. Height = 255
  187. Left = 105
  188. TabIndex = 22
  189. Top = 2415
  190. Width = 1620
  191. End
  192. Begin VB.Label Label6
  193. Caption = "Extension owner"
  194. Height = 255
  195. Left = 105
  196. TabIndex = 21
  197. Top = 1530
  198. Width = 1380
  199. End
  200. Begin VB.Label Label3
  201. Caption = "Executable name:"
  202. Height = 285
  203. Left = 105
  204. TabIndex = 20
  205. Top = 1860
  206. Width = 1335
  207. End
  208. Begin VB.Label Label2
  209. Caption = "Comment:"
  210. Height = 345
  211. Left = 105
  212. TabIndex = 19
  213. Top = 405
  214. Width = 1050
  215. End
  216. Begin VB.Label Label1
  217. Caption = "Display name:"
  218. Height = 345
  219. Left = 105
  220. TabIndex = 18
  221. Top = 75
  222. Width = 1050
  223. End
  224. End
  225. Attribute VB_Name = "frmExt"
  226. Attribute VB_GlobalNameSpace = False
  227. Attribute VB_Creatable = False
  228. Attribute VB_PredeclaredId = True
  229. Attribute VB_Exposed = False
  230. Option Explicit
  231. Private m_oFs As Scripting.FileSystemObject
  232. Private m_oHssExt As HssExt
  233. Const MAX_SKUS = 8
  234. Private m_aSkuIds(8) As String, m_ocollSkus As Scripting.Dictionary
  235. Sub DropFile(n As Node, ByVal strFN As String, ByVal strOwner As String)
  236. ' Me.Caption = "Drop of: " & strFN
  237. With Me
  238. .txtExecutable.Text = m_oFs.GetFileName(strFN)
  239. m_oHssExt.ExtensionFolder = m_oFs.GetParentFolderName(strFN)
  240. .txtSourceFolder = m_oHssExt.ExtensionFolder
  241. .txtExtensionFolder = HssX.txtExtensionsFolder + "\" + m_oFs.GetBaseName(.txtExecutable)
  242. .Show Modal:=vbModal
  243. End With
  244. End Sub
  245. Private Sub chkSku_Click(Index As Integer)
  246. If (Me.chkSku(Index).Value = vbChecked) Then
  247. If (Not m_ocollSkus.Exists(m_aSkuIds(Index))) Then
  248. m_ocollSkus.Add m_aSkuIds(Index), m_aSkuIds(Index)
  249. End If
  250. Else
  251. If (m_ocollSkus.Exists(m_aSkuIds(Index))) Then
  252. m_ocollSkus.Remove m_aSkuIds(Index)
  253. End If
  254. End If
  255. End Sub
  256. Private Sub cmdCancel_Click()
  257. Unload Me
  258. End Sub
  259. Private Sub cmdOK_Click()
  260. On Error GoTo Error_Handler
  261. ' OK, now it's time to persist this guy to disk
  262. ' Here we create the New Extension Node...
  263. ' WE validate the SKUs here because it's useless before
  264. m_oHssExt.ApplicableSkus = m_ocollSkus
  265. m_oHssExt.SaveToDisk Me.txtExtensionFolder
  266. Unload Me
  267. Common_Exit:
  268. Exit Sub
  269. Error_Handler:
  270. MsgBox Err.Description, vbInformation, Me.Caption
  271. GoTo Common_Exit
  272. End Sub
  273. Private Sub Form_Activate()
  274. ' Stop
  275. End Sub
  276. Private Sub Form_Initialize()
  277. Set m_oFs = New Scripting.FileSystemObject
  278. Set m_oHssExt = New HssExt
  279. m_aSkuIds(0) = "STD": m_aSkuIds(1) = "PRO": m_aSkuIds(2) = "SRV"
  280. m_aSkuIds(3) = "ADV": m_aSkuIds(4) = "DAT"
  281. m_aSkuIds(5) = "PRO64": m_aSkuIds(6) = "ADV64": m_aSkuIds(7) = "DAT64"
  282. m_aSkuIds(8) = "WINME":
  283. Set m_ocollSkus = New Scripting.Dictionary
  284. ' Stop
  285. End Sub
  286. Private Sub Form_Load()
  287. ' Stop
  288. End Sub
  289. Private Sub txtDisplayName_Validate(Cancel As Boolean)
  290. Cancel = False
  291. On Error Resume Next
  292. m_oHssExt.DisplayName = Me.txtDisplayName
  293. If (Err.Number <> 0) Then
  294. MsgBox Err.Description, vbInformation, "Error Entering Data"
  295. Cancel = True
  296. End If
  297. End Sub
  298. Private Sub txtExecutable_Validate(Cancel As Boolean)
  299. Cancel = False
  300. On Error Resume Next
  301. m_oHssExt.ExecutableName = Me.txtExecutable
  302. If (Err.Number <> 0) Then
  303. MsgBox Err.Description, vbInformation, "Error Entering Data"
  304. Cancel = True
  305. End If
  306. End Sub
  307. Private Sub txtExtensionFolder_Validate(Cancel As Boolean)
  308. Cancel = False
  309. Dim strExtFolder As String
  310. strExtFolder = Trim$(Me.txtExtensionFolder)
  311. If ((StrComp(HssX.txtExtensionsFolder, _
  312. m_oFs.GetParentFolderName(strExtFolder), _
  313. vbTextCompare) <> 0) _
  314. ) Then
  315. MsgBox "Extension Folder MUST be a Sub-directory " + vbCrLf + _
  316. "under Main extensions Directory", vbInformation, "Error Entering Data"
  317. Cancel = True
  318. GoTo Common_Exit
  319. End If
  320. Common_Exit:
  321. Exit Sub
  322. End Sub
  323. Private Sub txtOwner_Validate(Cancel As Boolean)
  324. Cancel = False
  325. On Error Resume Next
  326. m_oHssExt.Owner = Me.txtOwner
  327. If (Err.Number <> 0) Then
  328. MsgBox Err.Description, vbInformation, "Error Entering Data"
  329. Cancel = True
  330. End If
  331. End Sub