1 # Copyright (C) 2001-2006 William Joseph.
2 # For a list of contributors, see the accompanying CONTRIBUTORS file.
4 # This file is part of GtkRadiant.
6 # GtkRadiant is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # GtkRadiant is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GtkRadiant; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 def __init__(self, record):
27 def setstring(self, index, string):
28 self.record.setstring(index, string)
31 def __init__(self, view):
35 record = self.view.fetch()
37 raise Exception("no records available")
40 def update(self, record):
41 self.view.update(record.record)
44 def __init__(self, name):
45 self.msiDB = msiquery.MsiDB(name)
48 result = self.msiDB.commit()
50 raise Exception("msi commit failed: error " + str(result))
52 def openview(self, query):
53 view = self.msiDB.openview(query)
55 raise Exception("msi openview failed")
58 def setproperty(self, propertyName, propertyValue):
59 query = "UPDATE `Property` SET `Property`.`Value`='" + propertyValue + "' WHERE `Property`.`Property`='" + propertyName + "'"
62 def setlicense(self, rtfString):
63 view = self.openview("SELECT `Control`.`Text` FROM `Control` WHERE `Control`.`Control`='AgreementText'")
64 record = view.fetch();
65 record.setstring(1, rtfString)