-
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
FR: Access to 32/64bit registry keys in Custom Actions (using .NET3.5) #701
Comments
@oleg-shilo What are the limitations regarding using .NET >= 4 I understand that the project templates add a |
Hi Giles, The recommendation for using .NET3.5 is truly superficial. It's not based on any application field evidence. It is rather reflection of early stage of Wix# when .NET3.5 was still dominant and targeting the older CLR version was simply a safer choice in terms of probability of any compatibility issues. I do not longer believe that v3.5 is a good recommendation choice and after your this very prompt will change the recommendation to .NET4. And... the very current implementation of the public static void ValidateAssemblyCompatibility(Reflection.Assembly assembly)
{
//this validation is no longer critical as Wix# MAnagedSetup now fully supports .NET4.0
//if (!assembly.ImageRuntimeVersion.StartsWith("v2."))
// try
// {
// var msg = string.Format("Warning: assembly '{0}' is compiled for {1} runtime, which may not be compatible with the CLR version hosted by MSI. "+
// "The incompatibility is particularly possible for the Embedded UI scenarios. " +
// "The safest way to solve the problem is to compile the assembly for v3.5 Target Framework.",
// assembly.GetName().Name, assembly.ImageRuntimeVersion);
// Debug.WriteLine(msg);
// Console.WriteLine(msg);
// }
// catch { }
} |
I have just removed the Do you still think upgrading the recomendation to v4.0 automatically resolves registry 32/64bit roaming challenge? |
Yes using NET4 makes this FR redundant. |
All done now. |
I am having difficulty Debugging using |
No not really. I will be debugging your #704 so will tell you if I have the same problem. |
Just wanted to check with you. Your work around for #704, why did you opt for . . .
string message = null;
bool simple = true;
if (simple)
{
for (int i = messageRecord.FieldCount - 1; i > 0; i--)
{
message = messageRecord[i].ToString();
}
} Don't get me wrong, I do realize that the original solution looks quite questionable. That's why I need to debug it. |
OK, when I started debugging I remembered a few tricks...
Any other way my debugger fails to load the correct debug symbols. |
Release v1.11.1 * Issue #704: Question: Localized progress action messages. * Issue #696: ComponentCondition on CloseApplication doesn't appear to be working * Removed `ValidateAssemblyCompatibility`as no longer needed since .NET4.0 is arguably a better choice for the recommended runtime * Issue #604: Is it possible to suppress the "UAC prompt" text if UAC is not enabled? * Issue #701: FR: Access to 32/64bit registry keys in Custom Actions (using .NET3.5) * WixSharpVSIX (VS Templates): Release v1.8.3 - Migrated to .NET4.0 as target runtime - ManagedUI progress message localization improvements triggered by #704 * Added a `Property.Secure`: ```C# new Property("Gritting", "Hello World!"){ Secure = true }) ``` * More granular conditions for feature install/uninstall: ```C# var condition = feature.ShallInstall() && feature.IsInstalled(); ```
.NET 3.5 is the recommended CLR for wixsharp setup projects, however support for accessing both the 64bit and 32bit windows registry was not added until .NET version 4.0
Fortunately, backwards compatible access can be achieved using the following from StackOverflow:
https://stackoverflow.com/questions/26217199/what-are-some-alternatives-to-registrykey-openbasekey-in-net-3-5
I've tidied up the code and provided example use here:
https://gist.github.com/GilesBathgate/326de8355ebc829061de5840e39b043b
It would be really handy to have this available as a feature in WixSharp to save having to implement this manually in custom actions.
The text was updated successfully, but these errors were encountered: