inst-resources/dbal.nsh
author Dan
Tue, 08 Dec 2009 02:25:33 -0500
changeset 6 6016fd9e848f
parent 0 67e1cc6cd929
permissions -rw-r--r--
A couple minor fixes: more flexible version numbering; added a CreateDirectory before uninstaller generation (whoops)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     1
!macro db_connect result user pass
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     2
  Push "${user}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     3
  Push "${pass}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     4
  ClearErrors
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     5
  StrCmp $db_driver "mysql" 0 +3
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     6
    Call mysql_connect
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     7
    Goto +2
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     8
    Call postgresql_connect
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
     9
  Pop ${result}
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    10
!macroend
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    11
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    12
!define db_connect "!insertmacro db_connect"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    13
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    14
!macro db_create result user pass dbname nuser npass
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    15
  Push "${user}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    16
  Push "${pass}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    17
  Push "${dbname}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    18
  Push "${nuser}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    19
  Push "${npass}"
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    20
  StrCmp $db_driver "mysql" 0 +3
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    21
    Call mysql_create_db
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    22
    Goto +2
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    23
    Call postgresql_create_db
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    24
  Pop ${result}
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    25
!macroend
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    26
67e1cc6cd929 First commit. It's working!
Dan
parents:
diff changeset
    27
!define db_create "!insertmacro db_create"