예제 #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Startup startup = new Startup(Settings.Default.ApplicationName);
            string customerKey = startup.ReadRegistry();
            string connectionString = startup.RetrieveConnectionString(customerKey);

            textBoxCustomerKey.Text = customerKey;
            textBoxConnectionString.Text = connectionString;
        }
예제 #2
0
파일: Program.cs 프로젝트: h2chch/clickonce
        static void OnInstall()
        {
            //MessageBox.Show("Is Network Deployed: " + ApplicationDeployment.IsNetworkDeployed +
            //    "Is First Run: " + ApplicationDeployment.CurrentDeployment.IsFirstRun);

            Startup startup = new Startup(Settings.Default.ApplicationName);
            string customerKey = startup.ReadRegistry();

            if (ApplicationDeployment.IsNetworkDeployed && ApplicationDeployment.CurrentDeployment.IsFirstRun)
            {
                if (string.IsNullOrEmpty(customerKey))
                {
                    customerKey = startup.RetrieveCustomerKey();
                    startup.WriteRegistry(customerKey);
                }

                Settings.Default.IsFirstRun = false;
                Settings.Default.Save();
            }
        }