You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to update Media table in msi file through QDatabase. This code:
using (var package = new QDatabase(packagePath, DatabaseOpenMode.Transact))
{
var media = package.Medias.Where(m => m.DiskId == 1).AsEnumerable().First();
Console.WriteLine(media.LastSequence);
media.LastSequence = 20;
package.Commit();
}
throws exception:
Microsoft.Deployment.WindowsInstaller.InstallerException: Function failed during execution.
at Microsoft.Deployment.WindowsInstaller.View.Execute(Record executeParams)
at Microsoft.Deployment.WindowsInstaller.Database.Execute(String sql, Record record)
at Microsoft.Deployment.WindowsInstaller.Linq.QRecord.Update(IList`1 indexes, IList`1 values)
at Microsoft.Deployment.WindowsInstaller.Linq.Entities.Media_.set_LastSequence(Int32 value)
at line:
media.LastSequence = 20;
This code works fine:
using (var package = new Database(packagePath, DatabaseOpenMode.Transact))
{
package.Execute("UPDATE Media SET LastSequence = ? WHERE DiskId = ?", new Record(20, 1));
package.Commit();
}
And this code also works:
using (var package = new QDatabase(packagePath, DatabaseOpenMode.Transact))
{
var file = package.Files.Where(f => f.File == "SQLWizard.exe").AsEnumerable().First();
file.Version = "Hello, World!!!";
package.Commit();
}
Originally opened by bogser
The text was updated successfully, but these errors were encountered:
Unable to update Media table in msi file through QDatabase. This code:
throws exception:
at line:
This code works fine:
And this code also works:
The text was updated successfully, but these errors were encountered: