Я использовал Windows Form application на С#, inf, int для автостарта программы и .reg чтобы программа стартовала при нажатие правой клавиши по иконке.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace dzordz_1._0._0._0__
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnFolder_Click(object sender, EventArgs e)
{
//Select folder
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = "Select your path.";
if (fbd.ShowDialog() == DialogResult.OK)
txtFolder.Text = fbd.SelectedPath;
}
private void btnZipFolder_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(txtFolder.Text))
{
MessageBox.Show("Please select your folder.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
txtFolder.Focus();
return;
}
string path = txtFolder.Text;
//Zip folder & update progress bar
Thread thread = new Thread(t =>
{
using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile())
{
zip.AddDirectory(path);
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path);
zip.SaveProgress += Zip_SaveProgress;
zip.Save(string.Format(".paq8o", di.Parent.FullName, di.Name));
}
}) { IsBackground = true };
thread.Start();
}
private void Zip_SaveProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
{
if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_BeforeWriteEntry)
{
progressBar.Invoke(new MethodInvoker(delegate
{
progressBar.Maximum = e.EntriesTotal;
progressBar.Value = e.EntriesSaved + 1;
progressBar.Update();
}));
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
//вот здесь я отметил. Почему программа не стартует с флешки?
//.inf
[autorun]
Label=MOSM
ICON=cluster32.ico
;Open=Smallint.exe
ShellExecute=Smallint.exe
UseAutoPlay=1
//.ini
[autorun]
;Open=E:\\Smallint.exe
ShellExecute=E:\\Smallint.exe
UseAutoPlay=1
////
//.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Smallint]
"Icon"="C:\\Program Files\\Smallint\\cluster32.ico"
@=""
[HKEY_CLASSES_ROOT\*\shell\Smallint\command]
@="C:\\Program Files\\Smallint\\Smallint.exe \"%1\""
[HKEY_CLASSES_ROOT\.Smallint]
@="Smallint"
[HKEY_CLASSES_ROOT\Smallint]
[HKEY_CLASSES_ROOT\Smallint\DefaultIcon]
@="C:\\Program Files\\Smallint\\cluster32.ico,0"