-
Notifications
You must be signed in to change notification settings - Fork 182
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
Condition on RegValueProperty? #593
Comments
…element does not have condition (e.g. `RegistryKey`). Triggered by issue #593
I ended up just using a ManagedAction to read the Registry values and assign them to Session Properties. I used the Condition.NOT_Installed condition on the action. As for the second part it seems Windows Installer will also display the Change, Repair, Remove page even when UI is set to WUI.WixUI_FeatureTree which is what I am using. This code shows the issue I was having before switching to use a ManagedAction. private static void Main() {
var fullSetup = new Feature( "App" ) {
IsEnabled = false
};
var project =
new Project( "MyProduct",
new Dir( @"%ProgramFiles%\My Company\My Product",
new File( fullSetup, @"Program.cs" ) ),
new RegValueProperty( "ADDLOCAL", RegistryHive.LocalMachine, @"Software\My Company\My_Product", "Features", "App" ),
new RegValue( fullSetup, RegistryHive.LocalMachine, @"Software\My Company\My_Product", "Features", "[ADDLOCAL]" ).SetComponentPermanent( true )
) {
GUID = new Guid( "6f330b47-2577-43ad-9095-1861ba25889b" ),
UI = WUI.WixUI_FeatureTree,
PreserveTempFiles = true
};
project.BuildMsi();
} The first time you run it, it seems to work fine. Running it a second time displays this dialog: Anyway I have it working now so it is no big deal. |
Not a problem. BTW even if the UI you are using does not have this dialog the change/repair mode is still supported. This is what your very sample produces in ControlPanel: As you can see you can invoke both change and repair. Though because you don't have the dialog for that moth modes will simply trigger reinstallation. |
I think the Change, Repair Remove is built into the Default dialogs, it will only be displayed if you run the installation again after it has already been installed. If you comment out the RegValueProperty line in my example code it will work properly and be displayed the second time you run the install (without uninstalling first). The RegValueProperty seems to cause an issue when the install is run a second time and is already installed. Running a second time without first uninstalling with the RegValueProperty line in the code. Uninstall first. Comment out the RegValueProperty line, build and install (Note that you will need to Select the App Feature to be installed manually). Running a second time without first uninstalling with the RegValueProperty line commented out in the code. |
* Added new XML injection extensions `WixProject.AddXml` and `WixProject.AddXmlElement` * Issue #608: Create Shortcut on Desktop to dotnet.exe * Issue #551: Cannot include extra .wxs as part of a bundle * Issue #610: Warning when building two bundles in one setup * Issue #604: Is it possible to suppress the "UAC prompt" text if UAC is not enabled? * Issue #606: Platform.x64 not marking some folders win64="yes" * Issue #599: Files creating empty folders on Destination (2) * Issue #599: Files creating empty folders on Destination * Added `WixEntity.ComponentCondition` to assist with cases when WiX element does not have condition (e.g. `RegistryKey`). Triggered by issue #593 * Added support for attribute namespaces during XML auto serialization with `WixObject.ToXElement()` * Issue #586: How to add bal:overridable for Variable with wix# * Issue #591: Code signing timestamping fails if old Windows SDK is installed * Issue #585: Question: Warning about auto-generated IDs * Issue #580: Wrong path to the AdminToolsFolder * Add MsuPackage Element * Fix Condition Net462_Installed, Net47_Installed, Net471_Installed, Net472_Installed
Is there no way to specify a condition on RegValueProperty? The reason I am asking is because I load some
values into Properties and everything works fine on the first install. If I then run the install again without uninstalling it acts like the prev install did not finish correctly. I do not get the Repair, Remove etc. If I comment out the RegValueProperty lines it all works as expected. I would like to only call RegValueProperty if Condition.NOT_Installed returns true.
I also noticed Folder entries in the XML output when writing to the Registry. That does not seem correct.
The text was updated successfully, but these errors were encountered: