通过installshield在VS2012中创建可执行安装文件,但每次都失败 [英] making executable setup file in VS2012 ulitimate via installshield but getting failed everytime

查看:95
本文介绍了通过installshield在VS2012中创建可执行安装文件,但每次都失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i已在C#中提醒了应用程序,现在我想创建它以在其他PC上安装它,但每次我使用Flexera安装创建设置-shield,它创建一个永远不会安装的文件!我确信我正如教程中所说的那样正确。我的应用程序包含2个表单,这里是代码:



>第一页



hi

i have made a reminder application in C#, now i want to create setup of it to install it on other PCs but everytime i create setup using Flexera install-shield, it creates a file which never installs !! i am sure i am doing it correct as told in tutorials. My application contains 2 Forms here is the code:

> First Page

public partial class Form1 : Form
  {
      RegistryKey reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
      private NotifyIcon m_notifyicon;
      private ContextMenu m_menu;
      EntryForm ef = new EntryForm();

      public Form1()
      {
          Text = "TrayIcon test program";
          m_menu = new ContextMenu();
          m_menu.MenuItems.Add(0,
              new MenuItem("Show", new System.EventHandler(Show_Click)));
          m_menu.MenuItems.Add(1,
              new MenuItem("Hide", new System.EventHandler(Hide_Click)));
          m_menu.MenuItems.Add(2,
              new MenuItem("Exit", new System.EventHandler(Exit_Click)));
          m_notifyicon = new NotifyIcon();
          m_notifyicon.Text = "Right click for context menu";
          m_notifyicon.Visible = true;
          //m_notifyicon.Icon = new Icon(GetType(), "Icon1.ico");
          m_notifyicon.Icon = new Icon(@"C:\ic.ico");
          m_notifyicon.ContextMenu = m_menu;
          ef.Activate();
          reg.SetValue("Reminder_App_Varun", Application.ExecutablePath.ToString());
          InitializeComponent();
          this.StartPosition = FormStartPosition.Manual;
          this.Location = new Point(500, 220);

      }

      protected void Exit_Click(Object sender, System.EventArgs e)
      {
          Close();
      }
      protected void Hide_Click(Object sender, System.EventArgs e)
      {
          Hide();
      }
      protected void Show_Click(Object sender, System.EventArgs e)
      {
          Show();
      }
      protected override void Dispose(bool disposing)
      {
          if (disposing)
          {
              this.m_notifyicon.Dispose();
          }
          base.Dispose(disposing);
      }

      [STAThread]
      static void Main1()
      {
          Application.Run(new Form1());
      }





>第二张表格





> Second Form

public partial class EntryForm : Form
 {

     public EntryForm()
     {
         InitializeComponent();
         label9.Hide();
         panel2.Hide();
         configmail();
         cdate();
         checkdate();
         grid_bind();
         panel4.Hide();
         label14.Text = "No Selection";
         this.label11.Click += new System.EventHandler(this.ctrlClick);
     }
     private void ctrlClick(System.Object sender, EventArgs e)
     {
         Control ctrl = (Control)sender;
         panel4.Show();
     }

     protected override void WndProc(ref Message m)
     {
         base.WndProc(ref m);
         if (m.Msg == WM_NCHITTEST)
             m.Result = (IntPtr)(HT_CAPTION);
     }

     private const int WM_NCHITTEST = 0x84;
     private const int HT_CLIENT = 0x1;
     private const int HT_CAPTION = 0x2;
     private void button2_Click(object sender, EventArgs e)
     {

         checkdate();
     }

     private void checkdate()
     {
         DateTime dt = DateTime.Parse(label10.Text);
         long t = dt.ToFileTime();
         DateTime date1 = DateTime.Today;
         int result = DateTime.Compare(date1, dt);
         string relationship;
         if (result > 0)
         {
             relationship = "is earlier than";
         }
         else if (result == 0)
         {
             relationship = "is later than";
             SendEmail();
         }

         else
         {
             relationship = "is later than";
             SendEmail();
         }
         Console.WriteLine("{0} {1} {2}", date1, relationship, dt);
     }
     private void SendEmail()
     {
         try
         {
             OleDbConnection ncon = new OleDbConnection();
             ncon.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
             ncon.Open();
             OleDbCommand ncmd = new OleDbCommand("SELECT * FROM tb_sendmail WHERE (((remind_date)=#" + label13.Text + "#))", ncon);
             OleDbDataAdapter da = new OleDbDataAdapter(ncmd);
             DataTable ndt = new DataTable();
             da.Fill(ndt);
             //...FOR ERROR 5.5.1 SECURE CONNECTION GO TO https://www.google.com/settings/security/lesssecureapps AND TURN ON LESS SECURE APPS CONNECTION...////
             SmtpClient client = new SmtpClient("smtp.gmail.com");
             client.Port = 587;
             client.EnableSsl = true;
             client.Timeout = 100000;
             client.DeliveryMethod = SmtpDeliveryMethod.Network;
             client.UseDefaultCredentials = false;
             client.Credentials = new NetworkCredential("" + label7.Text + "", "" + label9.Text + "");
             MailMessage msg = new MailMessage();
             msg.To.Add("" + ndt.Rows[0][1].ToString() + "");
             msg.From = new MailAddress("vari.v5@gmail.com");
             msg.Subject = (""+ndt.Rows[0][2].ToString()+"");
             msg.Body = ("" + ndt.Rows[0][4].ToString() + "");
             client.Send(msg);
             MessageBox.Show("Successfully Sent Message.");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }

     private void button1_Click(object sender, EventArgs e)
     {
         this.Hide();
     }

     private void panel1_Paint(object sender, PaintEventArgs e)
     {

     }

     private void panel2_Paint(object sender, PaintEventArgs e)
     {




     }

     private void button3_Click(object sender, EventArgs e)//--------------email send pannel--------------//
     {
         OleDbConnection con = new OleDbConnection();
         con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
         con.Open();
         OleDbCommand cmd = new OleDbCommand("Insert into tb_sendmail (email_add,subject,remind_date,message) values (@email_add,@subject,@remind_date,@message)", con);
         if (con.State == ConnectionState.Open)
         {
             cmd.Parameters.Add("@email_add", OleDbType.VarChar).Value = textBox1.Text;
             cmd.Parameters.Add("@subject", OleDbType.VarChar).Value = textBox2.Text;
             cmd.Parameters.Add("@remind_date", OleDbType.Date).Value = textBox3.Text;
             cmd.Parameters.Add("@message", OleDbType.VarChar).Value = textBox4.Text;

             try
             {
                 cmd.ExecuteNonQuery();
                 MessageBox.Show("DATA ADDED");
                 dataGridView1.Refresh();

                 con.Close();
             }
             catch (OleDbException expe)
             {
                 MessageBox.Show(expe.Message);
                 con.Close();
             }
         }
         grid_bind();
     }

     private void grid_bind()
     {
         OleDbConnection conn = new OleDbConnection();
         conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
         conn.Open();
         OleDbDataAdapter oda;
         DataTable ndt;
         oda = new OleDbDataAdapter("SELECT ID,email_add,subject,remind_date,message from tb_sendmail", conn);
         ndt = new DataTable();
         oda.Fill(ndt);
         dataGridView1.DataSource = ndt;
     }

     private void button4_Click(object sender, EventArgs e)//--------------email address details pannel--------------//
     {
             OleDbConnection con = new OleDbConnection();
             con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
             con.Open();
             OleDbCommand cmd = new OleDbCommand("Update tb_email set email_address=@email_address,email_password=@email_password where ID = 1", con);
             if (con.State == ConnectionState.Open)
             {
                 cmd.Parameters.Add("@email_address", OleDbType.VarChar).Value = textBox5.Text;
                 cmd.Parameters.Add("@email_password", OleDbType.VarChar).Value = textBox6.Text;
                 try
                 {
                     cmd.ExecuteNonQuery();
                     MessageBox.Show("Email Address Saved Successfully");
                     con.Close();
                     panel2.Hide();
                     label7.Refresh();
                     button5.Show();
                 }
                 catch (OleDbException expe)
                 {
                     MessageBox.Show(expe.Message);
                     con.Close();
                 }
             }
     }

     private void button5_Click(object sender, EventArgs e)
     {
         panel2.Show();
         button5.Hide();

     }

     private void cdate()
     {
         DateTime dat = DateTime.Now;
         label13.Text = dat.ToString("MM/dd/yyyy");
         OleDbConnection ncon = new OleDbConnection();
         ncon.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
         ncon.Open();
         OleDbCommand ncmd = new OleDbCommand("SELECT * FROM tb_sendmail WHERE (((remind_date)=#" + label13.Text + "#))", ncon);
         OleDbDataAdapter da = new OleDbDataAdapter(ncmd);
         DataTable ndt = new DataTable();
         da.Fill(ndt);
         if (ndt.Rows.Count == 0 )
         {
             label10.Text = "01-09-2015";
         }
         else if (ndt.Rows.Count > 0)
         {

             MessageBox.Show(" TODAY is "+ label13.Text +", Perform your set action. Reminder has been sent on your Email. !");
             label10.Text = ndt.Rows[0][3].ToString();

             }

         else
         {
         label10.Text = ndt.Rows[0][3].ToString();
         }
     }
     private void configmail()
     {
         OleDbConnection con = new OleDbConnection();
         con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
         con.Open();
         OleDbCommand cmd = new OleDbCommand("Select * from tb_email", con);
         OleDbDataAdapter da = new OleDbDataAdapter(cmd);
         DataTable dt = new DataTable();
         da.Fill(dt);
         label7.Text = dt.Rows[0][1].ToString();
         label9.Text = dt.Rows[0][2].ToString();

     }

     private void EntryForm_Load(object sender, EventArgs e)
     {
     }

     private void timer1_Tick(object sender, EventArgs e)
     {

     }

     private void button8_Click(object sender, EventArgs e)//---------clear text-------//
     {
         clear_textbox();
     }

     private void clear_textbox()
     {
         textBox1.Text = "";
         textBox2.Text = "";
         textBox3.Text = "";
         textBox4.Text = "";
     }

     private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
     {
         textBox1.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
         textBox2.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
         textBox3.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
         textBox4.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
         label14.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
     }

     private void button6_Click(object sender, EventArgs e)
     {

     }

     private void button7_Click(object sender, EventArgs e)
     {
         OleDbConnection con = new OleDbConnection();
         con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RemindMe Beta 1.0\RemindMe Beta 1.0\sendmail.accdb";
         con.Open();
         OleDbCommand cmd = new OleDbCommand("Delete from tb_sendmail where ID = @ID", con);
         if (con.State == ConnectionState.Open)
         {
             cmd.Parameters.Add("@ID", OleDbType.Integer).Value = label14.Text;

             try
             {
                 cmd.ExecuteNonQuery();
                 MessageBox.Show("DATA Deleted !!");

                 con.Close();
             }
             catch (OleDbException expe)
             {
                 MessageBox.Show(expe.Message);
                 con.Close();
             }
         }
         else
         {
             MessageBox.Show("CON FAILED");
         }
         grid_bind();
         clear_textbox();
     }

     private void dataGridView1_SelectionChanged(object sender, EventArgs e)
     {
         label14.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
     }

     private void button6_Click_1(object sender, EventArgs e)
     {
         panel4.Hide();
     }

 }









我还附上了我的代码文件:

http://www.4shared.com/rar/Kh34lfL7ce/RemindMe_Beta_10.html



我是菜鸟,这是我的第一个项目所以请突出我的错误。



谢谢





I am also attaching my code file :
http://www.4shared.com/rar/Kh34lfL7ce/RemindMe_Beta_10.html

I am a noob and it is my first project so please highlight my mistakes in it.

Thanks

推荐答案

没有人在这里帮助我:( ???



c'on家伙我真的需要帮助请帮帮我
no one here to help me :( ???

c'on guys i really need help please help me


这篇关于通过installshield在VS2012中创建可执行安装文件,但每次都失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆