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