2

I have very weird scenario to handle.

We have an WIX based MSI installer. Now we want to bootstrap this MSI so I planned to use WIX Burn. Till now everything works fine. But I ran into a problem when I tried to upgrade from older versions of MSI to latest WIX Bundle.

The WIX bundle detects the upgrade nicely but I want to read the registry entry which the Older MSI has created. The registry entry which the older MSI has created have only permissions for Administrator. The reading of registry entry is very important because My UI depends on which version i am upgrading form. I know during Engine.Detect Callback i'll come to know about which version was previously installed. But I need to find some of the configuration file locations which I can do by reading the registry only. Moreover even if I can get the config file location the bundle running under medium integrity may not have permission to read the file. So is there a way i can elevate the execution of Bundle.exe

Kamal Deka
  • 148
  • 1
  • 14

1 Answers1

0

This is late to answer. I have figured out a hack which did the job for me.

  • I created an executable with Invoker=Admin in the manifest. Let say executable is RegistryACLUpdater.exe.
  • The RegistryACLUpdater will change the ACLs of the require registry entry to provide read permission to Authenticated users.
  • I bundled the executable in the WIX bundle
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
       <Payload SourceFile="$(var.exe_loc)\RegistryACLUpdater.exe"/>
    </BootstrapperApplicationRef>
  • Then I executed the exe using Verb="runas" to execute it in elevated mode.


    string RegistryAclUpdater = "RegistryACLUpdater.exe";
    string path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), RegistryAclUpdater);
    var processStartInfo = new ProcessStartInfo()
    {
       FileName = path,
       CreateNoWindow = true,
       UseShellExecute = true,
       RedirectStandardError = false,
       Arguments = arguments,
       Verb = "runas" //To execute in elevated mode.
    };

    var registryPermissionUpdater = new Process()
    {
       StartInfo = processStartInfo
    };

Kamal Deka
  • 148
  • 1
  • 14