private void install_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { string addinpath = @"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Autodesk\Revit\Addins\2017\" + DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".addin"; string dllpath = Dll.repeatFileName(@"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Autodesk\Revit\Addins\2017\" + Path.GetFileName(ofd.FileName)); //MessageBox.Show(dllpath); File.Copy(Path.GetFullPath(ofd.FileName), dllpath); Dll d = new Dll(dllpath); StreamWriter sw = new StreamWriter(addinpath); sw.WriteLine(d.exportAddin()); sw.Close(); MessageBox.Show("Success Save to \"" + d.toString() + "\" and create .addin manifest file.", "Success Install", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.Close(); } }
private void AddinInfo_Load(object sender, EventArgs e) { classname.Text = dll.toString(); }