Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6609083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:40:41+00:00 2026-05-25T19:40:41+00:00

I am trying to follow the code at this link in order to determine

  • 0

I am trying to follow the code at this link in order to determine in my installer class if the setup is ran as silent. But I must be doing something wrong, because the Context.Parameters[“UILevel”] seems to contain no value.

In my setup project, I added a custom action on Install, where I passed /UILevel=”[UILevel]” into CustomActionData field. I then linked this custom action to the primary output of the installer dll project, which contains the installer class below:

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;

namespace CustomActionLibrary
{
[RunInstaller(true)]
public partial class MyInstaller : Installer
{
    string uiLevelString = string.Empty;
    public bool IsSilentInstall
    {
        get 
        {
            if (!String.IsNullOrEmpty(uiLevelString))
            {
                int level = Convert.ToInt32(uiLevelString);
                return level <= 3;
            }
            else
                return false;
        }
    }

    public MyInstaller()
    {
        InitializeComponent();
    }

    public override void Install(IDictionary stateSaver)
    {
        base.Install(stateSaver);
        uiLevelString = Context.Parameters["UILevel"];
    }

    public override void Commit(IDictionary savedState)
    {
        //System.Diagnostics.Process.Start("http://www.google.ro?q=" + uiLevelString);
        if (IsSilentInstall)
        {
            //do stuff here if it's silent install.
        }
        base.Commit(savedState);
    }
    }
 }

I thought that if I add the custom action on Install, I should retrieve Context.Parameters[“UILevel”] in the Install override. But Context.Parameters[“UILevel”] never gets populated. I also tried retrieving it on the constructor of the class but it throws nullref, and in the commit event, but still nothing.

How could I properly retrieve this value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:40:42+00:00Added an answer on May 25, 2026 at 7:40 pm

    I solved it, it’s retrieving the UILevel value correctly on the AfterInstall event handler.

        private void SecureUpdaterInstaller_AfterInstall(object sender, InstallEventArgs e)
        {
            uiLevelString = this.Context.Parameters["UILevel"];
            System.Diagnostics.Process.Start("http://www.google.ro?q=afterInstall_" + uiLevelString);
        }
    

    It makes sense – it’s populating the value from the Install custom action, and it’s retrieving it on AfterInstall.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to follow this example (download the source code from a
I'm trying to do HEAD requests to follow 302 links, however this link: http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGrJk-F7Dmshmtze2yhifxRsv8sRg&url=http://www.mtv.com/news/articles/1647243/20100907/story.jhtml
I'm trying to follow code-to-interface on a project. Should I be creating an interface
I'm trying to follow the TableView programming guide, and I'm copying the code directly
I am trying to follow Trees tutorial at: http://cslibrary.stanford.edu/110/BinaryTrees.html Here is the code I
I'm basically trying to teach myself how to code and I want to follow
Trying to follow this example. (Section String sorting...) Is there anything obvious that would
I am trying to follow the steps on the following site http://msdn.microsoft.com/en-us/library/ms181089(VS.80).aspx But I
I'm trying to use marquee plugin of jQuery. but i get this error in
This is a follow-up to Dynamic Shared Library compilation with g++ . I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.