|
-
Apr 4th, 2007, 06:22 AM
#1
Thread Starter
New Member
HELP!!! Installer/Database Object has a file Locked...
Hi, I have a little program that edits an msi and generates a transform based on the changes
it all works except when I go to Delete the Temporary MSI - error is the file is in use by another process...I can't seem to work it out...any help would be greatly appreciated...
heres the relevant code
the line that errors is "My.Computer.FileSystem.DeleteFile(tmpName)"
I think it's to do with the objCopyDatabase object locking the file, but I have no clue how to release it...
objInstaller = CreateObject("WindowsInstaller.Installer")
objCopyDatabase = objInstaller.OpenDatabase(tmpName, 1)
objOrigDatabase = objInstaller.OpenDatabase(strBaseFileName, 0)
View = objCopyDatabase.OpenView("INSERT INTO `Property` (`Property`,`Value`) VALUES ('LICENSELOCATION', '" & frmMain.txtDir.Text & "')")
View.Execute() : View.Close() : objCopyDatabase.Commit()
View = objCopyDatabase.OpenView("INSERT INTO `Property` (`Property`,`Value`) VALUES ('LICENSEDTO', '" & frmMain.txtLic.Text & "')")
View.Execute() : View.Close() : objCopyDatabase.Commit()
View = objCopyDatabase.OpenView("INSERT INTO `Property` (`Property`,`Value`) VALUES ('SERVERID', '" & frmMain.txtServer.Text & "')")
View.Execute() : View.Close() : objCopyDatabase.Commit()
View = objCopyDatabase.OpenView("INSERT INTO `Property` (`Property`,`Value`) VALUES ('USERHOME', '" & frmMain.txtUser.Text & "')")
View.Execute() : View.Close() : objCopyDatabase.Commit()
View = Nothing
objCopyDatabase.GenerateTransform(objOrigDatabase, strWorkingDir & strBaseMSTName & ".mst")
'objCopyDatabase.CreateTransformSummaryInfo(objOrigDatabase, strWorkingDir & strBaseMSTName & ".mst", 0, 0)
objCopyDatabase.Commit()
objInstaller = Nothing
My.Computer.FileSystem.DeleteFile(tmpName)
Cheers
DiTcH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|