Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

c# - WixSharp installer Registry Creation

There are several posts regarding the creation of registry keys. However, i am trying to create the registry entries during radiobutton clicks.

I get the error message "Requested registry access is not allowed" when i try to access registry.

I tried with

project.InstallPrivileges = InstallPrivileges.elevated;
project.InstallScope = InstallScope.perMachine;

To have the admin privileges and also added the application manifest file and configured,

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

I noticed the application(Project) exe has the admin access now and wix installer doesn't have it.

Also, If i create the registries during build there is no issues. However, when user clicks on radio button on the UI, it doesnt seem to have admin rights

 var project = new Project("iaAgent",
        new Dir(@"%ProgramFiles%Test",
        new DirFiles(@"C:TestTestTestinDebug
etcoreapp3.1win-x64*.*")));
    project.InstallPrivileges = InstallPrivileges.elevated;
    project.InstallScope = InstallScope.perMachine;
    InjectProductActivationDialog(project);
    Compiler.PreserveTempFiles = true;

    //Reg Entries
    Compiler.BuildMsi(project);

Please help me to gain the admin access(UAC) screen whenever user executes the setup. Or is there any custom action to create the registry keys


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...