Initial commit to new repository

This commit is contained in:
2026-04-03 18:23:52 +09:00
commit deffb33cf9
5248 changed files with 267762 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<Nullable>annotations</Nullable>
<AssemblyName>AxCopilot_Setup</AssemblyName>
<ApplicationIcon>..\AxCopilot\Assets\icon.ico</ApplicationIcon>
<Version>1.8.0</Version>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
</ItemGroup>
<!-- 본체 ZIP 내장 (build.bat가 payload.zip 생성) -->
<ItemGroup>
<EmbeddedResource Include="payload.zip" Condition="Exists('payload.zip')">
<LogicalName>payload.zip</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,297 @@
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace AxCopilot.Installer.Offline
{
/// <summary>
/// WinForms 기본 MessageBox 대체 커스텀 다이얼로그.
/// 인스톨러 테마와 일관된 모던 디자인을 제공합니다.
/// </summary>
internal sealed class CustomMessageBox : Form
{
private DialogResult _result = DialogResult.Cancel;
private static readonly Color BgColor = Color.FromArgb(26, 27, 46);
private static readonly Color CardBg = Color.FromArgb(42, 43, 64);
private static readonly Color AccentCol = Color.FromArgb(75, 94, 252);
private static readonly Color TextCol = Color.FromArgb(224, 228, 240);
private static readonly Color SecondaryCol = Color.FromArgb(153, 153, 187);
private static readonly Color BorderCol = Color.FromArgb(60, 62, 90);
private CustomMessageBox(string message, string title, MessageBoxButtons buttons, MessageBoxIcon icon)
{
Text = title;
FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterScreen;
BackColor = BgColor;
DoubleBuffered = true;
ShowInTaskbar = false;
TopMost = true;
// ── 레이아웃을 TableLayoutPanel으로 구성 (겹침 방지) ──
var table = new TableLayoutPanel
{
Dock = DockStyle.Fill,
ColumnCount = 1,
RowCount = 3,
Padding = new Padding(28, 24, 28, 20),
BackColor = Color.Transparent,
AutoSize = true,
};
table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
table.RowStyles.Add(new RowStyle(SizeType.AutoSize)); // 제목
table.RowStyles.Add(new RowStyle(SizeType.AutoSize)); // 메시지
table.RowStyles.Add(new RowStyle(SizeType.AutoSize)); // 버튼
// ── Row 0: 아이콘 + 제목 ──
var titlePanel = new FlowLayoutPanel
{
FlowDirection = FlowDirection.LeftToRight,
AutoSize = true,
WrapContents = false,
Margin = new Padding(0, 0, 0, 12),
BackColor = Color.Transparent,
};
var iconText = GetIconPrefix(icon);
if (!string.IsNullOrEmpty(iconText))
{
titlePanel.Controls.Add(new Label
{
Text = iconText,
Font = new Font("Segoe UI", 14f),
ForeColor = GetIconColor(icon),
AutoSize = true,
Margin = new Padding(0, 0, 8, 0),
});
}
titlePanel.Controls.Add(new Label
{
Text = title,
Font = new Font("Segoe UI", 12f, FontStyle.Bold),
ForeColor = TextCol,
AutoSize = true,
MaximumSize = new Size(340, 0),
});
table.Controls.Add(titlePanel, 0, 0);
// ── Row 1: 메시지 본문 ──
var msgLabel = new Label
{
Text = message,
Font = new Font("Segoe UI", 10f),
ForeColor = TextCol,
AutoSize = true,
MaximumSize = new Size(360, 300),
Margin = new Padding(0, 0, 0, 20),
};
table.Controls.Add(msgLabel, 0, 1);
// ── Row 2: 버튼 영역 ──
var btnPanel = new FlowLayoutPanel
{
FlowDirection = FlowDirection.RightToLeft,
AutoSize = true,
WrapContents = false,
Anchor = AnchorStyles.Right,
Margin = new Padding(0),
BackColor = Color.Transparent,
};
switch (buttons)
{
case MessageBoxButtons.OK:
btnPanel.Controls.Add(CreateButton("확인", true, DialogResult.OK));
break;
case MessageBoxButtons.OKCancel:
btnPanel.Controls.Add(CreateButton("확인", true, DialogResult.OK));
btnPanel.Controls.Add(CreateButton("취소", false, DialogResult.Cancel));
break;
case MessageBoxButtons.YesNo:
btnPanel.Controls.Add(CreateButton("예", true, DialogResult.Yes));
btnPanel.Controls.Add(CreateButton("아니오", false, DialogResult.No));
break;
case MessageBoxButtons.YesNoCancel:
btnPanel.Controls.Add(CreateButton("예", true, DialogResult.Yes));
btnPanel.Controls.Add(CreateButton("아니오", false, DialogResult.No));
btnPanel.Controls.Add(CreateButton("취소", false, DialogResult.Cancel));
break;
}
table.Controls.Add(btnPanel, 0, 2);
Controls.Add(table);
// ── 크기 계산 (AutoSize 후) ──
table.PerformLayout();
var preferred = table.PreferredSize;
ClientSize = new Size(
Math.Max(380, Math.Min(preferred.Width + 10, 520)),
Math.Min(preferred.Height + 10, 500)
);
// 드래그 이동
table.MouseDown += DragForm;
titlePanel.MouseDown += DragForm;
msgLabel.MouseDown += DragForm;
// ESC / Enter
KeyPreview = true;
KeyDown += (s, e) =>
{
if (e.KeyCode == Keys.Escape)
{
_result = buttons == MessageBoxButtons.YesNo ? DialogResult.No : DialogResult.Cancel;
Close();
}
else if (e.KeyCode == Keys.Enter)
{
_result = (buttons == MessageBoxButtons.YesNo || buttons == MessageBoxButtons.YesNoCancel)
? DialogResult.Yes : DialogResult.OK;
Close();
}
};
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
// Region 클리핑 (약간 더 큰 반경으로 잘림 줄임)
using var clipPath = RoundRect(new Rectangle(0, 0, Width, Height), 18);
Region = new Region(clipPath);
var g = e.Graphics;
g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
// 배경 채우기 (Region 가장자리 보정)
using var bgBrush = new SolidBrush(BgColor);
using var bgPath = RoundRect(new Rectangle(0, 0, Width, Height), 18);
g.FillPath(bgBrush, bgPath);
// 테두리 (안쪽 1.5px, 부드러운 선)
using var borderPen = new Pen(Color.FromArgb(80, 90, 140), 1.5f);
using var borderPath = RoundRect(new Rectangle(1, 1, Width - 3, Height - 3), 16);
g.DrawPath(borderPen, borderPath);
}
private Button CreateButton(string text, bool isPrimary, DialogResult result)
{
var btn = new Button
{
Text = text,
Font = new Font("Segoe UI", 10f, isPrimary ? FontStyle.Bold : FontStyle.Regular),
ForeColor = TextCol,
BackColor = isPrimary ? AccentCol : CardBg,
FlatStyle = FlatStyle.Flat,
Size = new Size(90, 36),
Margin = new Padding(4, 0, 4, 0),
Cursor = Cursors.Hand,
};
btn.FlatAppearance.BorderSize = 0;
btn.Click += (s, e) => { _result = result; Close(); };
btn.Paint += (s, pe) =>
{
using var clipPath = RoundRect(new Rectangle(0, 0, btn.Width, btn.Height), 10);
btn.Region = new Region(clipPath);
var g = pe.Graphics;
g.SmoothingMode = SmoothingMode.HighQuality;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
// 배경
using var fillBrush = new SolidBrush(btn.BackColor);
using var fillPath = RoundRect(new Rectangle(0, 0, btn.Width, btn.Height), 10);
g.FillPath(fillBrush, fillPath);
// 테두리
using var bPen = new Pen(Color.FromArgb(70, 255, 255, 255), 0.8f);
using var bPath = RoundRect(new Rectangle(0, 0, btn.Width - 1, btn.Height - 1), 10);
g.DrawPath(bPen, bPath);
// 텍스트 직접 그리기
var sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
using var textBrush = new SolidBrush(btn.ForeColor);
g.DrawString(btn.Text, btn.Font, textBrush, new RectangleF(0, 0, btn.Width, btn.Height), sf);
};
return btn;
}
private static string GetIconPrefix(MessageBoxIcon icon)
{
return icon switch
{
MessageBoxIcon.Error => "✕",
MessageBoxIcon.Warning => "⚠",
MessageBoxIcon.Information => "",
MessageBoxIcon.Question => "?",
_ => "",
};
}
private static Color GetIconColor(MessageBoxIcon icon)
{
return icon switch
{
MessageBoxIcon.Error => Color.FromArgb(229, 62, 62),
MessageBoxIcon.Warning => Color.FromArgb(221, 107, 32),
MessageBoxIcon.Information => Color.FromArgb(75, 94, 252),
MessageBoxIcon.Question => Color.FromArgb(75, 94, 252),
_ => TextCol,
};
}
private void DragForm(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
NativeMethods.ReleaseCapture();
NativeMethods.SendMessage(Handle, 0xA1, (IntPtr)0x2, IntPtr.Zero);
}
}
private static GraphicsPath RoundRect(Rectangle rect, int radius)
{
var path = new GraphicsPath();
var d = radius * 2;
path.AddArc(rect.X, rect.Y, d, d, 180, 90);
path.AddArc(rect.Right - d, rect.Y, d, d, 270, 90);
path.AddArc(rect.Right - d, rect.Bottom - d, d, d, 0, 90);
path.AddArc(rect.X, rect.Bottom - d, d, d, 90, 90);
path.CloseFigure();
return path;
}
private static class NativeMethods
{
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
}
// ─── 정적 호출 메서드 (기존 MessageBox.Show 호환) ───────────────
public static DialogResult Show(string message)
=> Show(message, "AX Copilot", MessageBoxButtons.OK, MessageBoxIcon.None);
public static DialogResult Show(string message, string title)
=> Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.None);
public static DialogResult Show(string message, string title, MessageBoxButtons buttons)
=> Show(message, title, buttons, MessageBoxIcon.None);
public static DialogResult Show(string message, string title, MessageBoxButtons buttons, MessageBoxIcon icon)
{
var dlg = new CustomMessageBox(message, title, buttons, icon);
dlg.ShowDialog();
return dlg._result;
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Windows.Forms;
namespace AxCopilot.Installer.Offline
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new SetupForm());
}
}
}

View File

@@ -0,0 +1,324 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
namespace AxCopilot.Installer.Offline
{
public class SetupForm : Form
{
private const string AppName = "AX Copilot";
private const string AppVer = "1.8.0";
private const string Org = "AX\uC5F0\uAD6C\uC18C AI\uD300";
private const string RegUn = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\AxCopilot";
private const string RegRun = @"Software\Microsoft\Windows\CurrentVersion\Run";
private TextBox _pathBox;
private Label _status, _existLbl;
private Panel _existPnl, _progPnl;
private ProgressBar _prog;
private CheckBox _chkDesk, _chkAuto, _chkReg;
private Button _btnInst, _btnCanc, _btnBrowse, _btnDel;
private string _exPath, _exVer;
private static readonly string DefPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "AX Copilot");
[DllImport("gdi32.dll")] static extern IntPtr CreateRoundRectRgn(int a,int b,int c,int d,int e,int f);
[DllImport("user32.dll")] static extern int SetWindowRgn(IntPtr h,IntPtr r,bool re);
public SetupForm()
{
Text = AppName + " Setup"; Size = new Size(520, 470);
StartPosition = FormStartPosition.CenterScreen;
try { var ico = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); if (ico != null) Icon = ico; } catch { }
FormBorderStyle = FormBorderStyle.None; DoubleBuffered = true;
BackColor = Color.FromArgb(248, 249, 255);
Build(); Detect();
}
protected override void OnShown(EventArgs e)
{ base.OnShown(e); SetWindowRgn(Handle, CreateRoundRectRgn(0,0,Width,Height,20,20), true); }
// drag
private Point _ds; private bool _dg;
protected override void OnMouseDown(MouseEventArgs e) { if(e.Button==MouseButtons.Left&&e.Y<82){_dg=true;_ds=e.Location;} }
protected override void OnMouseMove(MouseEventArgs e) { if(_dg){var p=PointToScreen(e.Location);Location=new Point(p.X-_ds.X,p.Y-_ds.Y);} }
protected override void OnMouseUp(MouseEventArgs e) { _dg=false; }
protected override void OnMouseClick(MouseEventArgs e) { if(e.X>Width-40&&e.Y<30)Close(); }
protected override void OnPaint(PaintEventArgs e)
{
var g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias;
var hr = new Rectangle(0,0,Width,82);
using(var hb = new LinearGradientBrush(hr, Color.FromArgb(46,58,140), Color.FromArgb(75,94,252), 0f))
g.FillRectangle(hb, hr);
// Diamond icon in header (둥근 모서리)
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.TranslateTransform(40, 30);
g.RotateTransform(45);
FillRoundRect(g, new SolidBrush(Color.FromArgb(68,136,255)), 0, 0, 9, 9, 2.5f); // 상: Blue
FillRoundRect(g, new SolidBrush(Color.FromArgb(68,221,102)), 11, 0, 9, 9, 2.5f); // 우: Green
FillRoundRect(g, new SolidBrush(Color.FromArgb(68,221,102)), 0, 11, 9, 9, 2.5f); // 좌: Green
FillRoundRect(g, new SolidBrush(Color.FromArgb(255,68,102)), 11, 11, 9, 9, 2.5f); // 하: Red
g.ResetTransform();
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
using(var f1 = new Font("Segoe UI",18f,FontStyle.Bold)) g.DrawString(AppName,f1,Brushes.White,60,16);
using(var f2 = new Font("Segoe UI",9f))
g.DrawString(Org + " \u00b7 v" + AppVer,
f2, new SolidBrush(Color.FromArgb(170,187,255)), 60, 50);
using(var fc = new Font("Segoe UI",14f)) g.DrawString("\u00d7",fc,new SolidBrush(Color.FromArgb(140,170,204,255)),Width-30,4);
using(var pen = new Pen(Color.FromArgb(220,220,240))) g.DrawLine(pen,0,Height-56,Width,Height-56);
}
private void Build()
{
int y = 94;
_existPnl = new Panel{Left=20,Top=y,Width=Width-40,Height=30,BackColor=Color.FromArgb(255,248,225),Visible=false};
_existLbl = new Label{Dock=DockStyle.Fill,ForeColor=Color.FromArgb(146,64,14),Font=new Font("Segoe UI",9f),
TextAlign=ContentAlignment.MiddleLeft,Padding=new Padding(8,0,0,0)};
_existPnl.Controls.Add(_existLbl); Controls.Add(_existPnl); y+=38;
Controls.Add(new Label{Text="\uC124\uCE58 \uACBD\uB85C",Left=24,Top=y,AutoSize=true,
Font=new Font("Segoe UI",9.5f,FontStyle.Bold),ForeColor=Color.FromArgb(51,51,102)}); y+=22;
_pathBox = new TextBox{Left=24,Top=y,Width=Width-110,Height=26,Font=new Font("Consolas",10f),
Text=DefPath,BorderStyle=BorderStyle.FixedSingle};
Controls.Add(_pathBox);
_btnBrowse = Btn("\uBCC0\uACBD",Color.FromArgb(238,240,255),Color.FromArgb(75,94,252),Width-80,y-1,56,28);
_btnBrowse.Click += (s,ev)=>{using(var d=new FolderBrowserDialog{SelectedPath=_pathBox.Text})
if(d.ShowDialog()==DialogResult.OK)_pathBox.Text=d.SelectedPath;};
Controls.Add(_btnBrowse); y+=34;
Controls.Add(new Label{Text="\uBCF8\uCCB4 + .NET Runtime \uBAA8\uB450 \uB0B4\uC7A5 (\uC778\uD130\uB137 \uBD88\uD544\uC694)",
Left=24,Top=y,AutoSize=true,
Font=new Font("Segoe UI",8f),ForeColor=Color.FromArgb(153,153,187)}); y+=24;
_chkDesk = Chk("\uBC14\uD0D5\uD654\uBA74 \uBC14\uB85C\uAC00\uAE30 \uC0DD\uC131",true,24,y); y+=24;
_chkAuto = Chk("Windows \uC2DC\uC791 \uC2DC \uC790\uB3D9 \uC2E4\uD589",true,24,y); y+=24;
_chkReg = Chk("\uD504\uB85C\uADF8\uB7A8 \uCD94\uAC00/\uC81C\uAC70\uC5D0 \uB4F1\uB85D",true,24,y); y+=36;
_progPnl = new Panel{Left=20,Top=y,Width=Width-40,Height=42,Visible=false};
_status = new Label{Dock=DockStyle.Top,Height=20,Font=new Font("Segoe UI",9f),ForeColor=Color.FromArgb(75,94,252)};
_prog = new ProgressBar{Dock=DockStyle.Bottom,Height=10,Style=ProgressBarStyle.Continuous};
_progPnl.Controls.Add(_prog); _progPnl.Controls.Add(_status); Controls.Add(_progPnl);
int fy = Height-44;
Controls.Add(new Label{Text="v"+AppVer,Left=24,Top=fy+4,AutoSize=true,
Font=new Font("Segoe UI",8f),ForeColor=Color.FromArgb(187,187,204)});
_btnDel = Btn("\uC81C\uAC70",Color.FromArgb(254,226,226),Color.FromArgb(220,38,38),Width-270,fy,60,32);
_btnDel.Visible=false; _btnDel.Click+=async(s,ev)=>await Uninstall(); Controls.Add(_btnDel);
_btnCanc = Btn("\uCDE8\uC18C",Color.FromArgb(240,240,248),Color.FromArgb(102,102,136),Width-200,fy,68,32);
_btnCanc.Click+=(s,ev)=>Close(); Controls.Add(_btnCanc);
_btnInst = Btn("\uC124\uCE58",Color.FromArgb(75,94,252),Color.White,Width-122,fy,100,32);
_btnInst.Click+=async(s,ev)=>await Install(); Controls.Add(_btnInst);
}
private CheckBox Chk(string t,bool c,int x,int y){var cb=new CheckBox{Text=t,Checked=c,Left=x,Top=y,AutoSize=true,
Font=new Font("Segoe UI",9.5f),ForeColor=Color.FromArgb(85,85,119)};Controls.Add(cb);return cb;}
private Button Btn(string t,Color bg,Color fg,int x,int y,int w,int h){var b=new Button{Text=t,Left=x,Top=y,Width=w,Height=h,
FlatStyle=FlatStyle.Flat,BackColor=bg,ForeColor=fg,Font=new Font("Segoe UI",9.5f,FontStyle.Bold),Cursor=Cursors.Hand};
b.FlatAppearance.BorderSize=0;return b;}
private void Detect()
{
try{using(var k=Registry.CurrentUser.OpenSubKey(RegUn)){
_exPath=k!=null?k.GetValue("InstallLocation") as string:null;
_exVer=k!=null?k.GetValue("DisplayVersion") as string:null;}}catch{}
if(!string.IsNullOrEmpty(_exPath)&&Directory.Exists(_exPath)){
_pathBox.Text=_exPath;_existPnl.Visible=true;
_existLbl.Text=" \u26A0 \uAE30\uC874: v"+(_exVer??"")+" \u2014 "+_exPath;
_btnInst.Text="\uC5C5\uADF8\uB808\uC774\uB4DC";_btnDel.Visible=true;}
}
private async Task Install()
{
var path = _pathBox.Text.Trim();
if(string.IsNullOrEmpty(path)){CustomMessageBox.Show("\uC124\uCE58 \uACBD\uB85C\uB97C \uC785\uB825\uD558\uC138\uC694.");return;}
Busy(true);
try
{
St("앱 종료...",5); Kill(); await Task.Delay(500);
// ── 기존 AX Commander 마이그레이션 ──
MigrateFromAxCommander();
St("파일 설치...",20);
Directory.CreateDirectory(path);
ExtractZip(path);
await Task.Delay(300);
if(_chkDesk.Checked){St("바로가기...",60);
Lnk(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"AX Copilot.lnk"),
Path.Combine(path,"AxCopilot.exe"));}
St("시작 메뉴...",70);
var sm=Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu),"Programs","AX Copilot");
Directory.CreateDirectory(sm);
Lnk(Path.Combine(sm,"AX Copilot.lnk"),Path.Combine(path,"AxCopilot.exe"));
if(_chkAuto.Checked){St("\uC790\uB3D9 \uC2E4\uD589...",80);
using(var k=Registry.CurrentUser.OpenSubKey(RegRun,true)){if(k!=null)k.SetValue("AxCopilot","\""+Path.Combine(path,"AxCopilot.exe")+"\"");}}
// 인스톨러를 설치 폴더에 복사 (제거 기능용)
St("제거 프로그램 등록...",85);
try{var me=Assembly.GetExecutingAssembly().Location;
var dest=Path.Combine(path,"AxCopilot_Setup.exe");
if(!string.Equals(me,dest,StringComparison.OrdinalIgnoreCase))
File.Copy(me,dest,true);}catch{}
if(_chkReg.Checked){St("\uD504\uB85C\uADF8\uB7A8 \uB4F1\uB85D...",90);RegAdd(path);}
St("\uC124\uCE58 \uC644\uB8CC!",100); await Task.Delay(400);
if(CustomMessageBox.Show(AppName+" \uC124\uCE58 \uC644\uB8CC!\n\n"+Path.Combine(path,"AxCopilot.exe")+"\n\n\uC2E4\uD589\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
AppName,MessageBoxButtons.YesNo,MessageBoxIcon.Information)==DialogResult.Yes)
Process.Start(new ProcessStartInfo(Path.Combine(path,"AxCopilot.exe")){UseShellExecute=true});
Close();
}
catch(UnauthorizedAccessException){CustomMessageBox.Show("관리자 권한이 필요합니다.\n다른 경로를 선택하거나 관리자로 실행하세요.");Busy(false);}
catch(Exception ex){CustomMessageBox.Show("\uC124\uCE58 \uC2E4\uD328:\n"+ex.Message);Busy(false);}
}
private async Task Uninstall()
{
if(string.IsNullOrEmpty(_exPath))return;
if(CustomMessageBox.Show("\uC81C\uAC70\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?\n\n"+_exPath+"\n\n\uC124\uC815(%APPDATA%)\uC740 \uC720\uC9C0\uB429\uB2C8\uB2E4.",
AppName+" \uC81C\uAC70",MessageBoxButtons.YesNo,MessageBoxIcon.Question)!=DialogResult.Yes)return;
Busy(true);
try{
St("\uC571 \uC885\uB8CC...",10);Kill();await Task.Delay(500);
St("\uD30C\uC77C \uC0AD\uC81C...",30);
if(Directory.Exists(_exPath)){try{Directory.Delete(_exPath,true);}catch{
foreach(var f in Directory.GetFiles(_exPath))try{File.Delete(f);}catch{}}}
St("\uBC14\uB85C\uAC00\uAE30 \uC0AD\uC81C...",55);
Del(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"AX Copilot.lnk"));
Del(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"AX Commander.lnk")); // 레거시
var sm=Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu),"Programs","AX Copilot");
try{var smOld=Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu),"Programs","AX Commander");if(Directory.Exists(smOld))Directory.Delete(smOld,true);}catch{}
try{if(Directory.Exists(sm))Directory.Delete(sm,true);}catch{}
St("\uB808\uC9C0\uC2A4\uD2B8\uB9AC...",75);
try{using(var k=Registry.CurrentUser.OpenSubKey(RegRun,true)){if(k!=null)k.DeleteValue("AxCopilot",false);}}catch{}
try{Registry.CurrentUser.DeleteSubKey(RegUn,false);}catch{}
St("\uC81C\uAC70 \uC644\uB8CC!",100);await Task.Delay(400);
CustomMessageBox.Show("\uC81C\uAC70 \uC644\uB8CC.\n\uC124\uC815: %APPDATA%\\AxCopilot",AppName);Close();
}catch(Exception ex){CustomMessageBox.Show("\uC81C\uAC70 \uC2E4\uD328:"+ex.Message);Busy(false);}
}
private void Busy(bool b){_btnInst.Enabled=!b;_btnCanc.Enabled=!b;_btnDel.Enabled=!b;_progPnl.Visible=b;}
private void St(string t,int p){_status.Text=t;_prog.Value=Math.Min(p,100);Application.DoEvents();}
private static void Kill()
{
foreach(var p in Process.GetProcessesByName("AxCopilot"))try{p.Kill();p.WaitForExit(3000);}catch{}
foreach(var p in Process.GetProcessesByName("AxCommander"))try{p.Kill();p.WaitForExit(3000);}catch{} // 레거시
}
private static void Del(string f){try{if(File.Exists(f))File.Delete(f);}catch{}}
/// <summary>기존 AX Commander 설치를 감지하여 정리 + AppData 마이그레이션</summary>
private void MigrateFromAxCommander()
{
const string OldRegUn = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\AxCommander";
try
{
using var oldKey = Registry.CurrentUser.OpenSubKey(OldRegUn, false);
if (oldKey == null) return; // 기존 설치 없음
St("AX Commander → AX Copilot 업그레이드...", 8);
// 기존 설치 폴더 삭제
var oldPath = oldKey.GetValue("InstallLocation") as string;
if (!string.IsNullOrEmpty(oldPath) && Directory.Exists(oldPath))
try { Directory.Delete(oldPath, true); } catch { }
// 기존 바로가기 삭제
Del(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "AX Commander.lnk"));
var oldSm = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Programs", "AX Commander");
try { if (Directory.Exists(oldSm)) Directory.Delete(oldSm, true); } catch { }
// 기존 레지스트리 정리
try { using (var k = Registry.CurrentUser.OpenSubKey(RegRun, true)) { k?.DeleteValue("AxCommander", false); } } catch { }
try { Registry.CurrentUser.DeleteSubKey(OldRegUn, false); } catch { }
// %APPDATA%\AxCommander → %APPDATA%\AxCopilot 이동
var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
var oldDir = Path.Combine(appData, "AxCommander");
var newDir = Path.Combine(appData, "AxCopilot");
if (Directory.Exists(oldDir) && !Directory.Exists(newDir))
{
St("설정 데이터 마이그레이션...", 12);
try { Directory.Move(oldDir, newDir); } catch { }
}
St("마이그레이션 완료", 15);
}
catch { }
}
private void ExtractZip(string dest)
{
var asm = Assembly.GetExecutingAssembly();
var names = asm.GetManifestResourceNames();
string name = null;
foreach(var n in names) if(n.IndexOf("payload.zip",StringComparison.OrdinalIgnoreCase)>=0){name=n;break;}
if(name==null)throw new FileNotFoundException("payload.zip not found in embedded resources.");
using(var s = asm.GetManifestResourceStream(name))
using(var zip = new ZipArchive(s, ZipArchiveMode.Read))
{
int total = 0; foreach(var _ in zip.Entries) total++;
int done = 0;
foreach(var entry in zip.Entries)
{
var target = Path.Combine(dest, entry.FullName);
if(string.IsNullOrEmpty(entry.Name)){Directory.CreateDirectory(target);continue;}
var dir = Path.GetDirectoryName(target);
if(dir!=null) Directory.CreateDirectory(dir);
entry.ExtractToFile(target, true);
done++;
int pct = 20 + (done * 35 / Math.Max(total, 1));
St("\uD30C\uC77C \uC124\uCE58... ("+done+"/"+total+")", pct);
}
}
}
private static void FillRoundRect(Graphics g, Brush brush, float x, float y, float w, float h, float r)
{
using var path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddArc(x, y, r * 2, r * 2, 180, 90);
path.AddArc(x + w - r * 2, y, r * 2, r * 2, 270, 90);
path.AddArc(x + w - r * 2, y + h - r * 2, r * 2, r * 2, 0, 90);
path.AddArc(x, y + h - r * 2, r * 2, r * 2, 90, 90);
path.CloseFigure();
g.FillPath(brush, path);
}
private static void Lnk(string lnk,string target)
{
var iconPath = Path.Combine(Path.GetDirectoryName(target)??"", "Assets", "icon.ico");
var iconArg = File.Exists(iconPath) ? "$s.IconLocation='"+iconPath.Replace("'","''")+"';" : "";
var ps="$ws=New-Object -ComObject WScript.Shell;$s=$ws.CreateShortcut('"+lnk.Replace("'","''")+"');"+
"$s.TargetPath='"+target.Replace("'","''")+"';$s.WorkingDirectory='"+Path.GetDirectoryName(target).Replace("'","''")+"';"+
iconArg+"$s.Save()";
Process.Start(new ProcessStartInfo("powershell","-NoProfile -Command \""+ps+"\"")
{CreateNoWindow=true,UseShellExecute=false}).WaitForExit(5000);
}
private static void RegAdd(string dir)
{
try{using(var k=Registry.CurrentUser.CreateSubKey(RegUn)){
k.SetValue("DisplayName",AppName);
k.SetValue("DisplayVersion",AppVer);
k.SetValue("Publisher",Org);
k.SetValue("InstallLocation",dir);
k.SetValue("DisplayIcon",Path.Combine(dir,"AxCopilot.exe")+",0");
k.SetValue("UninstallString","\""+Path.Combine(dir,"AxCopilot_Setup.exe")+"\"");
k.SetValue("InstallDate",DateTime.Now.ToString("yyyyMMdd"));
k.SetValue("NoModify",1,RegistryValueKind.DWord);
k.SetValue("NoRepair",1,RegistryValueKind.DWord);
k.SetValue("EstimatedSize",72000,RegistryValueKind.DWord);}}catch{}
}
}
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.1.0" name="AxCopilot.Setup"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

View File

@@ -0,0 +1,58 @@
{
"format": 1,
"restore": {
"E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj": {}
},
"projects": {
"E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj": {
"version": "1.7.2",
"restore": {
"projectUniqueName": "E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj",
"projectName": "AxCopilot_Setup",
"projectPath": "E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "E:\\AX Copilot\\src\\AxCopilot.Installer\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net48"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.200"
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.201\\RuntimeIdentifierGraph.json"
}
},
"runtimes": {
"win-x86": {
"#import": []
}
}
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\admin\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\admin\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("AxCopilot_Setup")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.7.1.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.7.1")]
[assembly: System.Reflection.AssemblyProductAttribute("AxCopilot_Setup")]
[assembly: System.Reflection.AssemblyTitleAttribute("AxCopilot_Setup")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.7.1.0")]
// MSBuild WriteCodeFragment 클래스에서 생성되었습니다.

View File

@@ -0,0 +1 @@
b0ecaa163a313d5af7b0a607fb1d375c818edd550a5facb1dcab54e47d4ef5ba

View File

@@ -0,0 +1,14 @@
is_global = true
build_property.ApplicationManifest = app.manifest
build_property.StartupObject =
build_property.ApplicationDefaultFont =
build_property.ApplicationHighDpiMode =
build_property.ApplicationUseCompatibleTextRendering =
build_property.ApplicationVisualStyles =
build_property.RootNamespace = AxCopilot.Installer
build_property.ProjectDir = E:\AX Copilot\src\AxCopilot.Installer\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =

View File

@@ -0,0 +1 @@
cdeb201644c87f7c493d903f57cc22b1f80777359a33a9d6401d43e2b0005fa8

View File

@@ -0,0 +1,20 @@
E:\AX Commander\src\AxCopilot.Installer\bin\Debug\net48\AxCopilot_Setup.exe.config
E:\AX Commander\src\AxCopilot.Installer\bin\Debug\net48\AxCopilot_Setup.exe
E:\AX Commander\src\AxCopilot.Installer\bin\Debug\net48\AxCopilot_Setup.pdb
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.csproj.AssemblyReference.cache
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.GeneratedMSBuildEditorConfig.editorconfig
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.AssemblyInfoInputs.cache
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.AssemblyInfo.cs
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.csproj.CoreCompileInputs.cache
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot_Setup.exe
E:\AX Commander\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot_Setup.pdb
E:\AX Copilot\src\AxCopilot.Installer\bin\Debug\net48\AxCopilot_Setup.exe.config
E:\AX Copilot\src\AxCopilot.Installer\bin\Debug\net48\AxCopilot_Setup.exe
E:\AX Copilot\src\AxCopilot.Installer\bin\Debug\net48\AxCopilot_Setup.pdb
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.csproj.AssemblyReference.cache
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.GeneratedMSBuildEditorConfig.editorconfig
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.AssemblyInfoInputs.cache
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.AssemblyInfo.cs
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot.Installer.csproj.CoreCompileInputs.cache
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot_Setup.exe
E:\AX Copilot\src\AxCopilot.Installer\obj\Debug\net48\AxCopilot_Setup.pdb

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("AxCopilot_Setup")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.7.2.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.7.2")]
[assembly: System.Reflection.AssemblyProductAttribute("AxCopilot_Setup")]
[assembly: System.Reflection.AssemblyTitleAttribute("AxCopilot_Setup")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.7.2.0")]
// MSBuild WriteCodeFragment 클래스에서 생성되었습니다.

View File

@@ -0,0 +1 @@
9fc97ba95fb895eafec34720944a95d7ef26ca1178a342b4d606134cf9a22f91

View File

@@ -0,0 +1,14 @@
is_global = true
build_property.ApplicationManifest = app.manifest
build_property.StartupObject =
build_property.ApplicationDefaultFont =
build_property.ApplicationHighDpiMode =
build_property.ApplicationUseCompatibleTextRendering =
build_property.ApplicationVisualStyles =
build_property.RootNamespace = AxCopilot.Installer
build_property.ProjectDir = E:\AX Copilot\src\AxCopilot.Installer\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =

View File

@@ -0,0 +1 @@
d0902e3a45ac1669ecad6c4a76499ce8c92ddecaaca00815b0d092f937f62404

View File

@@ -0,0 +1,10 @@
E:\AX Copilot\src\AxCopilot.Installer\bin\Release\net48\AxCopilot_Setup.exe.config
E:\AX Copilot\src\AxCopilot.Installer\bin\Release\net48\AxCopilot_Setup.exe
E:\AX Copilot\src\AxCopilot.Installer\bin\Release\net48\AxCopilot_Setup.pdb
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot.Installer.csproj.AssemblyReference.cache
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot.Installer.GeneratedMSBuildEditorConfig.editorconfig
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot.Installer.AssemblyInfoInputs.cache
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot.Installer.AssemblyInfo.cs
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot.Installer.csproj.CoreCompileInputs.cache
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot_Setup.exe
E:\AX Copilot\src\AxCopilot.Installer\obj\Release\net48\AxCopilot_Setup.pdb

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

View File

@@ -0,0 +1,64 @@
{
"version": 3,
"targets": {
".NETFramework,Version=v4.8": {},
".NETFramework,Version=v4.8/win-x86": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETFramework,Version=v4.8": []
},
"packageFolders": {
"C:\\Users\\admin\\.nuget\\packages\\": {}
},
"project": {
"version": "1.7.2",
"restore": {
"projectUniqueName": "E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj",
"projectName": "AxCopilot_Setup",
"projectPath": "E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "E:\\AX Copilot\\src\\AxCopilot.Installer\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net48"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.200"
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.201\\RuntimeIdentifierGraph.json"
}
},
"runtimes": {
"win-x86": {
"#import": []
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "szcmjiT3MpM=",
"success": true,
"projectFilePath": "E:\\AX Copilot\\src\\AxCopilot.Installer\\AxCopilot.Installer.csproj",
"expectedPackageFiles": [],
"logs": []
}