/build/static/layout/Breadcrumb_cap_w.png

Help. Installer/Database Error

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()

objCopyDatabase = Nothing
objOrigDatabase = Nothing
objInstaller = Nothing

My.Computer.FileSystem.DeleteFile(tmpName)



Cheers
DiTcH

0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ