home *** CD-ROM | disk | FTP | other *** search
/ Techno Guide - Aspettando Windows 98 / TechnoGuide.iso / utility / hcopy32 / swsetup.inf < prev    next >
Text File  |  1997-04-12  |  14KB  |  421 lines

  1. DialogLoggingOff 'Init Setup, please wait ...'
  2.  
  3. deutsch = 1
  4. english = 2
  5.  
  6. tMeldung[deutsch][1] = 'Hardcopy Installation'
  7. tMeldung[english][1] = 'Hardcopy installation'
  8.  
  9. tMeldung[deutsch][2] = 'Es wird jetzt das Programm Hardcopy installiert.\r\n\r\nDas Programm Hardcopy erm÷glicht es Ihnen ⁿber einen Tastendruck, ([Druck]-Taste) den Bildschirminhalt auszudrucken oder auch abzuspeichern.'
  10. tMeldung[english][2] = 'Setup is ready to install Hardcopy.\r\n\r\nHardcopy is a utility that is used to print out your screen or window.\r\n\r\nKey [Print] - prints out the current screen.\r\nKey [Alt+Print] - prints out current window.'
  11.  
  12. tMeldung[deutsch][3] = 'Bitte geben Sie hier das Verzeichnis an, in welchem Sie das Hardcopy-Programm installieren wollen,\r\noder verwenden Sie "Auswahl...", um ein anderes Verzeichnis auszuwΣhlen.'
  13. tMeldung[english][3] = '\r\n\r\nPlease type the directory for install the the Hardcopy program\r\nor use the "Browse..." for select a directory.'
  14.  
  15. tMeldung[deutsch][4] = 'Bitte geben Sie hier die Programmgruppe an, in welchem Sie das Hardcopy-Programm eintragen wollen,\r\noder verwenden Sie "Auswahl...", um ein andere Gruppe auszuwΣhlen.'
  16. tMeldung[english][4] = '\r\n\r\nPlease type the program group for Hardcopy\r\nor use the "Browse..." for select a program group.'
  17.  
  18. tMeldung[deutsch][5] = 'Hardcopy - Bildschirmausdruck'
  19. tMeldung[english][5] = 'Hardcopy - Print Screen'
  20.  
  21. tMeldung[deutsch][6] = 'Das Verzeichnis kann nicht angelegt werden !'
  22. tMeldung[english][6] = 'Unable to create the directory !'
  23.  
  24. If __WinVersion__ >= 4
  25.     i = StrrChr __AutostartVerzeichnis__ '\\'
  26.     vTemp = Mid __AutostartVerzeichnis__ ( i + 1 ) 255
  27. Else
  28.     vTemp = 'Autostart'
  29. EndIf
  30. tMeldung[deutsch][7] = 'Hardcopy in die Gruppe %vTemp% eintragen.'
  31. tMeldung[english][7] = 'Create a Icon for Hardcopy in the %vTemp% group.'
  32.  
  33. tMeldung[deutsch][8] = 'Hardcopy nach dem Beenden der Installation starten.'
  34. tMeldung[english][8] = 'Start Hardcopy at the end from the installation.'
  35.  
  36. tMeldung[deutsch][9] = 'Die Installation ist Ok, Sie k÷nnen nun das Programm Hardcopy starten.'
  37. tMeldung[english][9] = 'Setup is complete.  You may run the Hardcopy program.'
  38.  
  39. tMeldung[deutsch][10] = 'Die Installation ist Ok, Hardcopy wurde gestartet.'
  40. tMeldung[english][10] = 'Setup is complete. Hardcopy has been startet.'
  41.  
  42. tMeldung[deutsch][11] = 'Bitte Verzeichnis auswΣhlen'
  43. tMeldung[english][11] = 'Please select a directory'
  44.  
  45. tMeldung[deutsch][12] = 'Bitte eine Programmgruppe auswΣhlen'
  46. tMeldung[english][12] = 'Please select a Program Group'
  47.  
  48. tMeldung[deutsch][13] = 'Programm-Icon/Gruppe kann nicht angelegt werden'
  49. tMeldung[english][13] = 'Error, can not create program-icon/group'
  50.  
  51.  
  52. If __Language__ == 'deu'
  53.    sprache = deutsch
  54. Else
  55.    sprache = english
  56. EndIf       
  57.  
  58. vAutostart = 0        // Hardcopy in die Autostartgruppe eintragen
  59. vExec = 0        // Hardcopy nach beenden der Installation starten
  60. vAutostart = 1        // Hardcopy in Autostart eintragen
  61. vExec = 1        // Hardcopy nach der Installation ausfⁿhren
  62.  
  63. vInstallDirVon = pwd
  64.  
  65. vClient  = ' '
  66. vClient  = GetIniFile '%vInstallDirVon%\\setup.ini' 'Client' 'ClientInstallation'
  67. vClientG = ' '
  68. vClientG = GetIniFile '%vInstallDirVon%\\setup.ini' 'Client' 'ClientGroup'
  69.  
  70. vTitle = tMeldung[sprache][1]
  71.  
  72. vIni = ' '
  73. vIni = GetIniFile '%vInstallDirVon%\\setup.ini' 'Verwendung' 'Cr2'
  74. If vIni > ' '
  75.     vTitle = '%vTitle%\r\n %vIni%'
  76. EndIf
  77.  
  78. CreateBackground vTitle
  79.  
  80. vLogFileName    = '%__WindowsVerzeichnis__%\\Hardcopy.log'
  81.  
  82. fp = fopen vLogFileName 'w'                             
  83. If __error__ == 0
  84.     MessageBox 'Logdatei ''%vLogFileName%'' kann nicht ge÷ffnet werden'
  85.     Exit
  86. EndIf
  87.  
  88. Fehler = 0
  89.  
  90. fputs fp '\nInstallation Hardcopy\n\n'
  91.  
  92. fputs fp '           Datum/Uhrzeit: \t%__Date__%\n'
  93. fputs fp '                Language: \t%__Language__%\n'
  94. fputs fp '              WinVersion: \t%__WinVersion__%\n'
  95. fputs fp '                WinMinor: \t%__WinMinor__%\n'
  96. fputs fp '               WinSystem: \t%__WinSystem__%\n'
  97. fputs fp '                CpuModel: \t%__CpuModel__%\n'
  98. fputs fp '                 BsBuild: \t%__BsBuild__%\n'
  99. fputs fp '                 CpuType: \t%__CpuType__%\n'
  100. fputs fp '      WindowsVerzeichnis: \t%__WindowsVerzeichnis__%\n'
  101. fputs fp 'WindowsSystemVerzeichnis: \t%__WindowsSystemVerzeichnis__%\n'
  102. fputs fp '                 Desktop: \t%__DesktopVerzeichnis__%\n'
  103. fputs fp '               Startmenⁿ: \t%__StartVerzeichnis__%\n'
  104. fputs fp '               Programme: \t%__ProgrammVerzeichnis__%\n'
  105. fputs fp '               Autostart: \t%__AutostartVerzeichnis__%\n'
  106. fputs fp '\n'
  107.  
  108. If vClient == 'yes'
  109.     fputs fp '               Client-Installation\n'
  110. Else
  111.     fputs fp '               Standard-Installation\n'
  112. EndIf
  113.  
  114. cd 'c:\\'
  115.  
  116. vDir   = 'c:\\hardcopy'
  117. If vClient == 'yes'
  118.     If __System32__ == 1
  119.         vDir = '%vInstallDirVon%\\bin32'
  120.     Else
  121.         vDir = '%vInstallDirVon%\\bin16'
  122.     EndIf
  123. EndIf
  124. vPrgGrp = tMeldung[sprache][5]
  125.  
  126. If __WinVersion__ >= 4
  127.     WizardCreate
  128.     __WizardTitle__ = tMeldung[sprache][1]
  129.  
  130.     :page1
  131.         rc = WizardPageText     __WizardNext__    tMeldung[sprache][2]
  132.         if rc == __WizardCancel__
  133.             fputs fp 'Der Benutzer hat die Installation abgebrochen !\n'
  134.             exit
  135.         EndIf
  136.  
  137.     :page2
  138.         If vClient != 'yes'
  139.             __WizardBitmap__ = '%vInstallDirVon%\\Hardcpy1.bmp'
  140.             rc = WizardPageBrowse (__WizardBack__ + __WizardNext__) DIR tMeldung[sprache][3] vDir
  141.             if rc == __WizardBack__
  142.                 Goto :page1
  143.             EndIf
  144.             if rc == __WizardCancel__
  145.                 fputs fp 'Der Benutzer hat die Installation abgebrochen !\n'
  146.                 exit
  147.             EndIf
  148.  
  149.             mkdir vDir
  150.             If __error__ == 0
  151.                fputs fp '%tMeldung[sprache][6]%\n'
  152.                MessageBox tMeldung[sprache][6]
  153.                GoTo :page2
  154.             EndIf
  155.             rmdir vDir
  156.         EndIf
  157.  
  158.     :page3
  159.         If vClientG == ' '
  160.             __WizardBitmap__ = '%vInstallDirVon%\\Hardcpy2.bmp'
  161.             rc = WizardPageBrowse (__WizardBack__ + __WizardFinish__) GROUP tMeldung[sprache][4] vPrgGrp CHECK vAutostart tMeldung[sprache][7] vExec tMeldung[sprache][8]
  162.             if rc == __WizardBack__
  163.                 Goto :page2
  164.             EndIf
  165.             if rc == __WizardCancel__
  166.                 fputs fp 'Der Benutzer hat die Installation abgebrochen !\n'
  167.                 exit
  168.             EndIf
  169.         Else
  170.             vPrgGrp = vClientG
  171.         EndIf
  172.  
  173.     WizardClose
  174.     mkdir vDir
  175. Else
  176.     // ------------ Verzeichnis
  177.     :NeuerVersuch
  178.     If vClient != 'yes'
  179.         cd 'c:\\'
  180.         vDir = SelectDir vDir tMeldung[sprache][11]
  181.         If __error__ == 0
  182.             fputs fp 'Der Benutzer hat die Installation abgebrochen !\n'
  183.             Exit
  184.         EndIf
  185.  
  186.         mkdir vDir
  187.         If __error__ == 0
  188.            fputs fp '%tMeldung[sprache][6]%\n'
  189.            MessageBox tMeldung[sprache][6]
  190.            GoTo :NeuerVersuch
  191.         EndIf
  192.     EndIf
  193.  
  194.     // ------------ Program-group
  195.     :NeuerVersuch2
  196.     If vClientG == ' '
  197.         vPrgGrp = SelectProgramGroup tMeldung[sprache][5] tMeldung[sprache][12]
  198.         If __error__ == 0
  199.             fputs fp 'Der Benutzer hat die Installation abgebrochen !\n'
  200.             Exit
  201.         EndIf
  202.     Else
  203.         vPrgGrp = vClientG
  204.     EndIf
  205. EndIf
  206.  
  207.  
  208. DialogLoggingOn
  209.  
  210. fputs fp 'Installation von:  %vInstallDirVon%\n'
  211. fputs fp 'Installation nach: %vDir%\n\n'
  212.  
  213. // falls noch alte Installationen vorhanden sind, diese umbenennen !
  214. MoveFile '%__WindowsVerzeichnis__%\\Hardcopy.exe' '%__WindowsVerzeichnis__%\\Hardcopy.alt'
  215. MoveFile '%__WindowsVerzeichnis__%\\HcpntDll.Dll' '%__WindowsVerzeichnis__%\\HcpNtDll.alt'
  216. MoveFile '%__WindowsVerzeichnis__%\\HcpDll.Dll'   '%__WindowsVerzeichnis__%\\HcpDll.alt'
  217.  
  218. If vClient != 'yes'
  219.     // falls noch alte Installationen vorhanden sind, diese umbenennen !
  220.     MoveFile '%vDir%\\HcpDll.dll'   '%vDir%\\hcpdll.old'   
  221.     MoveFile '%vDir%\\HcpntDll.dll' '%vDir%\\hcpntdll.old'   
  222.     MoveFile '%vDir%\\Hardcopy.exe' '%vDir%\\hardcopy.old' 
  223.  
  224.     If __System32__ == 1
  225.        CopyFile '%vInstallDirVon%\\HcpNTdll.dll' '%vDir%\\hcpntdll.dll' UNPACK Always fp
  226.        Fehler += __Error__
  227.        CopyFile '%vInstallDirVon%\\HrdCpy32.exe' '%vDir%\\hardcopy.exe' UNPACK Always fp
  228.        Fehler += __Error__
  229.     Else        // windows95 oder windows 3.n
  230.        CopyFile '%vInstallDirVon%\\HcpDll.dll'   '%vDir%\\hcpdll.dll'   UNPACK fp
  231.        Fehler += __Error__
  232.        CopyFile '%vInstallDirVon%\\Hardcopy.exe' '%vDir%\\hardcopy.exe' UNPACK fp
  233.        Fehler += __Error__
  234.     Endif
  235. EndIf
  236.  
  237. // falls vorhanden
  238. CopyFile '%vInstallDirVon%\\hcpdll.ini' '%vDir%\\hcpdll.ini' Always
  239.  
  240. // falls vorhanden
  241. If __Language__ == 'deu'
  242.     If __WinVersion__ < 4
  243.         CopyFile '%vInstallDirVon%\\hardco3d.hlp' '%vDir%\\hardcopy.hlp' Always
  244.     Else
  245.         CopyFile '%vInstallDirVon%\\hardcopd.hlp' '%vDir%\\hardcopy.hlp' Always
  246.     EndIf
  247.     // f = fopen '%vDir%\\Hardcopy.cnt' 'w'
  248.     // fputs f ':Base hardcopy.hlp\n'
  249.     // fputs f '1 Hardcopy\n'
  250.     // fputs f '2 Allgemeines=main_index\n'
  251.     // fputs f '2 Installation=installation\n'
  252.     // fputs f '1 Menⁿs\n'
  253.     // fputs f '2 dies kommt mit der nΣchsten Version=aaa\n'
  254.     // fclose f
  255.  
  256. Else
  257.     If __WinVersion__ < 4
  258.         CopyFile '%vInstallDirVon%\\hardco3e.hlp' '%vDir%\\hardcopy.hlp' Always
  259.     Else
  260.         CopyFile '%vInstallDirVon%\\hardcope.hlp' '%vDir%\\hardcopy.hlp' Always
  261.     EndIf
  262. EndIf
  263.  
  264. fputs fp '\n'
  265.  
  266.  
  267. // ------------ Hardcopy.ini
  268. tini[0] = 'Cr'
  269. tini[1] = 'Cr2'
  270. tini[2] = 'Cr3'
  271. tini[3] = 'menu'
  272. tini[4] = 'taskbar'
  273. tini[5] = 'DeleteClipboard'
  274. tini[6] = 'Network'
  275. tini[7] = 'PrintDate'
  276. tini[8] = 'SaveAs'
  277. tini[9] = 'Gif'
  278. tini[10] = 'Mono'
  279. i = 11
  280. While i
  281.     i --
  282.     vIni = ' '
  283.     vIni = GetIniFile '%vInstallDirVon%\\setup.ini' 'Verwendung' tini[i]
  284.     If vIni != ' '
  285.         SetIniFile '%__WindowsVerzeichnis__%\\hardcopy.ini' 'Verwendung' tini[i] vIni
  286.     EndIf
  287. EndWhile
  288.  
  289. // ------------ Hardcopy-icon
  290. CreateItem '\\PG\\%vPrgGrp%' 'Hardcopy' '%vDir%\\Hardcopy.exe' '' '%vDir%' '%vDir%\\Hardcopy.exe' 0 1
  291. If __error__ == 0
  292.    fputs fp '%tMeldung[sprache][13]%\n'
  293.    MessageBox tMeldung[sprache][13]
  294.    GoTo :NeuerVersuch2
  295. EndIf
  296. fputs fp 'Ok: CreateItem "%vPrgGrp%" ---> Hardcopy\n'
  297.  
  298. // ------------ Hardcopy-icon in Autostart
  299. If vAutostart
  300.     CreateItem '\\PS\\' 'Hardcopy' '%vDir%\\Hardcopy.exe' '' '%vDir%' '%vDir%\\Hardcopy.exe' 0 1
  301.     If __error__ == 0
  302.        fputs fp 'Error Create Icon "Autostart"\n'
  303.     Else
  304.        fputs fp 'Ok: CreateItem "Autostart" ---> Hardcopy\n'
  305.     EndIf
  306. EndIf
  307.  
  308. // ------------ Readme
  309. vReadme = 'ReadMe'
  310. If __Language__ == 'deu'
  311.    vReadme = 'LiesMich'
  312. EndIf
  313. If __Language__ == 'fra'
  314.    vReadme = 'Lisezmoi'
  315. EndIf
  316. If __Language__ == 'frb'
  317.    vReadme = 'Lisezmoi'
  318. EndIf
  319. If __Language__ == 'frc'
  320.    vReadme = 'Lisezmoi'
  321. EndIf
  322.  
  323. If vClient != 'yes'
  324.     CopyFile   '%vInstallDirVon%\\readme.txt' '%vDir%\\%vReadme%.txt' fp
  325.     CreateItem '\\PG\\%vPrgGrp%' vReadme 'notepad' '%vDir%\\%vReadme%.txt' '%vDir%' 'notepad.exe' 0 0
  326. Else
  327.     CreateItem '\\PG\\%vPrgGrp%' vReadme 'notepad' '%vInstallDirVon%\\readme.txt' '%vDir%' 'notepad.exe' 0 0
  328. EndIf
  329.  
  330.  
  331.  
  332. // ------------ Uninstall Hardcopy with Registry
  333. vUninst = 'Uninstall Hardcopy'
  334. If __Language__ == 'deu'
  335.    vUninst = 'Hardcopy entfernen'
  336. EndIf
  337.  
  338. If __WinVersion__ < 4
  339.    CreateItem '\\PG\\%vPrgGrp%' vUninst 'SwSetupu.exe' '%__WindowsVerzeichnis__%\\hardcopy.del' '%__WindowsVerzeichnis__%' '%__WindowsVerzeichnis__%\\SwSetupu.exe' 0 0
  340. Else
  341.    SetRegistry 'HKEY_LOCAL_MACHINE' 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Hardcopy' 'DisplayName' 'Uninstall Hardcopy'
  342.    If __Error__ != 0
  343.       MessageBox 'Error Set Registry (Uninstall DisplayName).'
  344.    EndIf
  345.  
  346.    SetRegistry 'HKEY_LOCAL_MACHINE' 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Hardcopy' 'UninstallString' 'SwSetupu %__WindowsDirectory__%\\Hardcopy.del'
  347.    If __Error__ != 0
  348.       MessageBox 'Error Set Registry (UninstallString).'
  349.    EndIf
  350. EndIf
  351.  
  352.  
  353. fpDel = fopen '%__WindowsVerzeichnis__%\\hardcopy.del' 'w'                             
  354. If __error__ == 0
  355.    fputs fp   'Datei ''%vDir%\\hardcopy.del'' kann nicht ge÷ffnet werden\n'
  356.    MessageBox 'Datei ''%vDir%\\hardcopy.del'' kann nicht ge÷ffnet werden'
  357.    Fehler = 1
  358. EndIf
  359. vT1 = 'Uninstall Hardcopy'
  360. vT2 = 'This will remove "Hardcopy".\\nDo you wish continue ?'
  361. vT3 = 'Hardcopy removed.'
  362. If __Language__ == 'deu'
  363.    vT1 = 'Hardcopy entfernen'
  364.    vT2 = 'M÷chten Sie tatsΣchlich Hardcopy entfernen ?'
  365.    vT3 = 'Hardcopy wurde entfernt !'
  366. EndIf
  367. fputs fpDel 'CreateBackground  ''%vT1%''\n'
  368. fputs fpDel 'DialogOut         ''%vT1%''\n'
  369. fputs fpDel 'MessageBox        ''%vT2%'' 36\n'
  370. fputs fpDel 'If __error__ == 6\n'
  371. If vClient != 'yes'
  372. fputs fpDel '   DeleteFile     ''%vDir%\\\\HcpNTdll.Dll''\n'
  373. fputs fpDel '   DeleteFile     ''%vDir%\\\\Hardcopy.exe''\n'
  374. fputs fpDel '   DeleteFile     ''%vDir%\\\\Hardcopy.hlp''\n'
  375. fputs fpDel '   DeleteFile     ''%vDir%\\\\Hardcopy.gid''\n'
  376. fputs fpDel '   DeleteFile     ''%vDir%\\\\HcpDll.Dll''\n'
  377. fputs fpDel '   DeleteFile     ''%vDir%\\\\HcpNTdll.old''\n'
  378. fputs fpDel '   DeleteFile     ''%vDir%\\\\Hardcopy.old''\n'
  379. fputs fpDel '   DeleteFile     ''%vDir%\\\\HcpDll.old''\n'
  380. fputs fpDel '   DeleteFile     ''%vDir%\\\\%vReadme%.txt''\n'
  381. fputs fpDel '   rmdir          ''%vDir%''\n'
  382. EndIf
  383. fputs fpDel '   DeleteFile     ''%%__WindowsVerzeichnis__%%\\\\hardcopy.log''\n'
  384. fputs fpDel '   DeleteFile     ''%%__WindowsVerzeichnis__%%\\\\hardcopy.del''\n'
  385. fputs fpDel '   DeleteFile     ''%%__WindowsVerzeichnis__%%\\\\hardcopy.ini''\n'
  386. fputs fpDel '   CreateItem     ''-\\\\PG\\\\%vPrgGrp%'' ''Hardcopy''  '''' '''' '''' '''' 0 0\n'
  387. fputs fpDel '   CreateItem     ''-\\\\PS\\\\%vPrgGrp%'' ''Hardcopy''  '''' '''' '''' '''' 0 0\n'
  388. fputs fpDel '   CreateItem     ''-\\\\PG\\\\%vPrgGrp%'' ''%vReadme%'' '''' '''' '''' '''' 0 0\n'
  389. fputs fpDel '   CreateItem     ''-\\\\PG\\\\%vPrgGrp%'' ''%vUninst%'' '''' '''' '''' '''' 0 0\n'
  390. fputs fpDel '   DeleteRegistry ''HKEY_LOCAL_MACHINE'' ''SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\Hardcopy'' ''''\n'
  391. fputs fpDel '   MessageBox ''%vT3%''\n'
  392. fputs fpDel 'EndIf\n'
  393. // ------------ 
  394.  
  395.  
  396. fputs fp '\nEnde\n'
  397.  
  398. If Fehler != 0
  399.    vText = '\r\nError by installation, will you see the installation-log ?'
  400.    If __Language__ == 'deu'
  401.       vText = '\r\nBei der Installation ist ein Fehler aufgetreten,\r\nsoll die Installations-Logdatei angezeigt werden ?'
  402.    EndIf
  403.    MessageBox vText 36
  404.    If __error__ == 6
  405.     fclose fp
  406.     Exec 'notepad %vLogFileName%'
  407.     Exit
  408.    EndIf
  409. Endif
  410.  
  411. If Fehler == 0
  412.    If vExec
  413.     Exec '%vDir%\\Hardcopy.exe' 2
  414.     MessageBox tMeldung[sprache][10]
  415.    Else
  416.     MessageBox tMeldung[sprache][9]
  417.    EndIf
  418. EndIf
  419.  
  420. fclose fp
  421.