Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstallPackage.Consolidate() bug #4389

Open
wixbot opened this issue Apr 16, 2014 · 3 comments
Open

InstallPackage.Consolidate() bug #4389

wixbot opened this issue Apr 16, 2014 · 3 comments
Milestone

Comments

@wixbot
Copy link

wixbot commented Apr 16, 2014

Running this code ends up with an error message in v3.7 and v3.8.

                using (InstallPackage pkg = new InstallPackage(filePath, DatabaseOpenMode.Transact))
                {
                    pkg.Consolidate(cabName);
                    pkg.Commit();
                }

Error: Function failed during execution.
at Microsoft.Deployment.WindowsInstaller.SummaryInfo.Persist()
at Microsoft.Deployment.WindowsInstaller.Database.Commit()

After Consolidate, any call to change the SummaryInfo also ends up with an error code:

Error: Function failed during execution.
at Microsoft.Deployment.WindowsInstaller.SummaryInfo.set_Item(UInt32 property, Type type, Object value)
at Microsoft.Deployment.WindowsInstaller.SummaryInfo.set_Item(UInt32 property, String value)
at Microsoft.Deployment.WindowsInstaller.SummaryInfo.set_LastSavedBy(String value)

It seems that there is a problem with Consolidate, because I can change the SummaryInfo and then Commit with no error.

Also, with DatabaseOpenMode.Direct, at the end of using() I get a "function failed during execution" exception with the following StackTrace:
at Microsoft.Deployment.WindowsInstaller.SummaryInfo.Persist()
at Microsoft.Deployment.WindowsInstaller.Database.Commit()
at Microsoft.Deployment.WindowsInstaller.Database.Dispose(Boolean disposing)
at Microsoft.Deployment.WindowsInstaller.InstallerHandle.Dispose()

Originally opened by gigipedala

@wixbot
Copy link
Author

wixbot commented Apr 17, 2014

I figured out that I need to call SummaryInfo.Close(), then no errors would appear. I think it should be mentioned in the docs somewhere, or an example, that the SummaryInfo should be closed before calling InstallPackage.Commit. Only one problem remained, the stream isn't flushed and the msi file size remains the same even if the consolidate used an external cab.

Originally posted by gigipedala

@wixbot
Copy link
Author

wixbot commented Apr 17, 2014

Area set to sdk
Release changed from v3.8 to v3.x

@wixbot
Copy link
Author

wixbot commented Apr 22, 2014

Some new info: when consolidate uses an internal cab, the cab is made first in the temporary folder, and a second call to consolidate crashes because the cab is still in use. A workaround would be to call the carbage collector between 2 consolidate calls.

Originally posted by gigipedala

@wixbot wixbot added this to the v3.x milestone Dec 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant