home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 January / PCWELT_1_2006.ISO / pcwsoft / autoit-v3-setup.exe / Extras / _install_syntax_files.au3 next >
Encoding:
Text File  |  2004-02-26  |  2.0 KB  |  47 lines

  1. ;
  2. ; AutoIt Version: 3.0
  3. ; Language:       English
  4. ; Platform:       Win9x/NT
  5. ; Author:         Jonathan Bennett <jon at hiddensoft com>
  6. ;
  7. ; Script Function:
  8. ;    Syntax highlighting files installation.
  9. ;
  10.  
  11. ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
  12. $answer = MsgBox(4, "TextPad v4", "This script will attempt to automatically install syntax highlighting and clip library files for TextPad v4.  Run?")
  13. If $answer = 7 Then Exit
  14.  
  15. ; Find an verify the installation directory
  16. $installdir = @ProgramFilesDir & "\TextPad 4\"
  17.  
  18. ; Check that the directory exists
  19. If Not FileExists($installdir) Then Error()
  20.  
  21. If Not FileCopy("autoit_v3.syn", $installdir & "\system", 1) Then Error()
  22. If Not FileCopy("autoit_v3.tcl", $installdir & "\samples", 1) Then Error()
  23.  
  24.  
  25. ; Now write the reg keys
  26. RegWrite("HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\AutoIt v3", "Type", "REG_DWORD", 2)
  27. RegWrite("HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\AutoIt v3", "Members", "REG_MULTI_SZ", "*.au3")
  28. RegWrite("HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\AutoIt v3", "Properties", "REG_BINARY", "2a002e0061007500330000000000")
  29. RegWrite("HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\AutoIt v3", "SyntaxProps", "REG_BINARY", "01000000")
  30. RegWrite("HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\AutoIt v3", "SyntaxFile", "REG_SZ", "autoit_v3.syn")
  31. RegWrite("HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\AutoIt v3", "WordChars", "REG_SZ", "_$")
  32.  
  33. $answer = MsgBox(4096+4, "TextPad v4", "Installation complete!" & @LF & @LF & "Do you want to make it the default editor for AutoItV3 scripts ?")
  34. If $answer = 7 Then Exit
  35. RegWrite("HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", '"' & $installdir & 'TextPad.exe" "%1"')
  36.  
  37. ; End of script
  38.  
  39.  
  40. Func Error()
  41.     MsgBox(4096, "Error", "Unable to find TextPad or error installing the syntax files.  Please try a manual installation.")
  42.     Exit
  43. EndFunc
  44.  
  45.  
  46.  
  47.