Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: Injecting dialog is shown incorrectly

$
0
0
Thank you I wasn't aware about know this one.

Injected C LR dialog needs to position and resize itself properly on the screen just where the native MSI UI dialog was before proceeding to the CLR dialog by clicking Next button. The vital part of this positioning is to find the handle of the main Window of the msi process. The default algorithm works well but I guess it fails when the msi process is elevated because of the InstallScope.perMachine.

Making the default algorithm more sophisticated can be a difficult time consuming exercise. However making it work for a specific scenario like yours is relatively simple. You will need to implement your own algorithm of finding the window. For that you need to overwrite the GetMsiForegroundWindow method of WixCLRDialog:
protectedoverride IntPtr GetMsiForegroundWindow()
{
    var handle = base.GetMsiForegroundWindow();

    if (handle == IntPtr.Zero)
        handle = Win32.FindWindow(null, "natka setup");

    return handle;
}
In this case I assumed that your main msi (setup) window has title "natka setup";

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>