File: installer.vbs

package info (click to toggle)
pike8.0 8.0.702-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 79,608 kB
  • sloc: ansic: 266,508; xml: 186,324; makefile: 3,537; sh: 1,731; cpp: 1,328; lisp: 655; awk: 441; asm: 242; objc: 240; pascal: 157; perl: 34; sed: 34
file content (55 lines) | stat: -rw-r--r-- 1,669 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'
' Companion file to bin/install.pike for custom actions.
'
' 2004-12-01 Henrik Grubbstr�m
'

'Option Compare Binary

' At call time the CustomActionData property has been set to [TARGETDIR]
Function FinalizePike()
  Dim fso, targetdir, targetdir_unix, source, source_txt, dest, re
  targetdir = Session.Property("CustomActionData")

  Set fso = CreateObject("Scripting.FileSystemObject")

  ' Note: Opening the files in ASCII-mode, there doesn't seem to be any
  '       binary mode. This means that 8-bit characters might get mangled.
  Set source = fso.OpenTextFile(targetdir & "lib\master.pike.in", 1, False, 0)
  Set dest = fso.CreateTextFile(targetdir & "lib\master.pike", True, False)

  source_txt = source.ReadAll

  source.Close

  Set re = New RegExp
  re.Global = True

  re.Pattern = "\\"
  targetdir_unix = re.Replace(targetdir, "/")

  re.Pattern = "#lib_prefix#"
  source_txt = re.Replace(source_txt, targetdir_unix & "lib")

  re.Pattern = "#include_prefix#"
  source_txt = re.Replace(source_txt, targetdir_unix & "include/pike")

  're.Pattern = "#share_prefix#"
  'source_txt = re.Replace(source_txt, "#share_prefix#")

  dest.Write(source_txt)
  dest.Close

  ' Warning: It appears to be very difficult to call pike from here to do
  ' finalizing stuff. The problem is that if the MS CRT libs are used, and
  ' they get installed at the same time, then pike can't use them from here.
  ' Many attempts to get around that have failed. /mast

  ' Extra cleanup.
  If fso.FileExists(targetdir & "bin\pike.exe.old") Then
    WshShell.Run "%windir%\system32\cmd /c del bin\pike.exe.old" &_
      " /f", 0, True
  End If

  FinalizePike = 1
End Function