This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- set OverwriteMainOptions to 1 instead of 4
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 04, 2010
08:08 AM
installshield 2009 automation - File property "Always overwrite"
How can I set file property "Always overwrite" in component.
In Direct Editor -> File Table I need set 2 property on my file:
Version = 65535.0.0.0
ISAttributes = 17
I found only this available properties (С#):
ISWiAuto15.ISWiProject project = new ISWiAuto15.ISWiProject();
project.OpenProject("c:\\ism\\test04.ism", false);
ISWiComponents components = project.ISWiComponents;
foreach (ISWiComponent cmp in components)
{
ISWiFiles fls = cmp.ISWiFiles;
foreach (ISWiFile fl in fls)
{
Console.WriteLine("Name = " + fl.Name);
Console.WriteLine("DisplayName = " + fl.DisplayName);
Console.WriteLine("DynamicFile = " + fl.DynamicFile.ToString());
Console.WriteLine("FontTitle = " + fl.FontTitle);
Console.WriteLine("FullPath = " + fl.FullPath);
Console.WriteLine("get_Attributes = " + fl.get_Attributes());
Console.WriteLine("Hidden = " + fl.Hidden);
Console.WriteLine("Languages = " + fl.Languages);
Console.WriteLine("Modified = " + fl.Modified);
Console.WriteLine("OverrideSystemAttributes = " + fl.OverrideSystemAttributes);
Console.WriteLine("OverrideSystemLanguage = " + fl.OverrideSystemLanguage);
Console.WriteLine("OverrideSystemSize = " + fl.OverrideSystemSize);
Console.WriteLine("OverrideSystemVersion = " + fl.OverrideSystemVersion);
Console.WriteLine("ReadOnly = " + fl.ReadOnly);
Console.WriteLine("SelfRegister = " + fl.SelfRegister);
Console.WriteLine("ShortName = " + fl.ShortName);
Console.WriteLine("Size = " + fl.Size);
Console.WriteLine("System = " + fl.System);
Console.WriteLine("UseSystemSettings = " + fl.UseSystemSettings);
Console.WriteLine("Version = " + fl.Version);
Console.WriteLine("Vital = " + fl.Vital);
}
}
project.CloseProject();
In Direct Editor -> File Table I need set 2 property on my file:
Version = 65535.0.0.0
ISAttributes = 17
I found only this available properties (С#):
ISWiAuto15.ISWiProject project = new ISWiAuto15.ISWiProject();
project.OpenProject("c:\\ism\\test04.ism", false);
ISWiComponents components = project.ISWiComponents;
foreach (ISWiComponent cmp in components)
{
ISWiFiles fls = cmp.ISWiFiles;
foreach (ISWiFile fl in fls)
{
Console.WriteLine("Name = " + fl.Name);
Console.WriteLine("DisplayName = " + fl.DisplayName);
Console.WriteLine("DynamicFile = " + fl.DynamicFile.ToString());
Console.WriteLine("FontTitle = " + fl.FontTitle);
Console.WriteLine("FullPath = " + fl.FullPath);
Console.WriteLine("get_Attributes = " + fl.get_Attributes());
Console.WriteLine("Hidden = " + fl.Hidden);
Console.WriteLine("Languages = " + fl.Languages);
Console.WriteLine("Modified = " + fl.Modified);
Console.WriteLine("OverrideSystemAttributes = " + fl.OverrideSystemAttributes);
Console.WriteLine("OverrideSystemLanguage = " + fl.OverrideSystemLanguage);
Console.WriteLine("OverrideSystemSize = " + fl.OverrideSystemSize);
Console.WriteLine("OverrideSystemVersion = " + fl.OverrideSystemVersion);
Console.WriteLine("ReadOnly = " + fl.ReadOnly);
Console.WriteLine("SelfRegister = " + fl.SelfRegister);
Console.WriteLine("ShortName = " + fl.ShortName);
Console.WriteLine("Size = " + fl.Size);
Console.WriteLine("System = " + fl.System);
Console.WriteLine("UseSystemSettings = " + fl.UseSystemSettings);
Console.WriteLine("Version = " + fl.Version);
Console.WriteLine("Vital = " + fl.Vital);
}
}
project.CloseProject();
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 04, 2010
11:48 AM
You can use the ISWiComponent.OverwriteMainOptions property in order to set the "Always overwrite" option. See the ISWiComponent Object help topic for more information.
Hope that helps.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 05, 2010
01:46 AM
ISWiComponent.OverwriteMainOptions property work only with InstallScript, InstallScript Object. My project type is BasicMSI
Found solution:
Type installerType = Type.GetTypeFromProgID("WindowsInstaller.Installer");
Installer installer = (Installer)Activator.CreateInstance(installerType);
Database database = installer.OpenDatabase("c:\\ism\\test04.ism", MsiOpenDatabaseMode.msiOpenDatabaseModeTransact);
View view2 = database.OpenView("UPDATE File SET Version='65535.0.0.0' WHERE File='tftp.exe'");
view2.Execute(null);
View view3 = database.OpenView("UPDATE File SET ISAttributes='17' WHERE File='tftp.exe'");
view3.Execute(null);
database.Commit();
Found solution:
Type installerType = Type.GetTypeFromProgID("WindowsInstaller.Installer");
Installer installer = (Installer)Activator.CreateInstance(installerType);
Database database = installer.OpenDatabase("c:\\ism\\test04.ism", MsiOpenDatabaseMode.msiOpenDatabaseModeTransact);
View view2 = database.OpenView("UPDATE File SET Version='65535.0.0.0' WHERE File='tftp.exe'");
view2.Execute(null);
View view3 = database.OpenView("UPDATE File SET ISAttributes='17' WHERE File='tftp.exe'");
view3.Execute(null);
database.Commit();
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 05, 2010
01:56 PM
You can also use the InstallShield automation code below for Basic MSI projects to set the Always Overwrite setting:
ISWiFile.OverrideSystemVersion = True;
ISWiFile.Version = "65535.0.0.0";
I filed the work order #IOA-000057647 so that the InstallShield automation interface will support the ISWiFile.AlwaysOverwrite property in a future release.
ISWiFile.OverrideSystemVersion = True;
ISWiFile.Version = "65535.0.0.0";
I filed the work order #IOA-000057647 so that the InstallShield automation interface will support the ISWiFile.AlwaysOverwrite property in a future release.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 24, 2010
12:57 PM
How do I do this if I am using DynamicFileLinking in a basic MSI project?:confused:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 26, 2012
05:42 PM
You get to set OverwriteMainOptions to 1 instead of 4 so it works as the option #4 per installshield 2011 help files. (when using the automation object to create installscript projects)