Thursday, August 14, 2008

Add an uninstall and him shortcut to .NET deployment project in VS2005

Got this post from : http://gaaton.blogspot.com/2006/07/add-uninstall-and-him-shortcut-to-net.html

Thanks!

1. Create simple project UninstallApp.
2. Add in
Main()
{
string[] arguments = Environment.GetCommandLineArgs();
foreach(string argument in arguments)
{
string[] parameters = argument.Split('=');

if (parameters[0].ToLower() == "/u")
{
string productCode = parameters[1];
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
Process proc = new Process();
proc.StartInfo.FileName = string.Concat(path,file://msiexec.exe/);
proc.StartInfo.Arguments = string.Concat(" /i ", productCode);
proc.Start();
}
}

3. Create new setup project
4. Add UninstallApp.exe to "Application Folder" in 'File System' part
5. In "User's Program menu" create shortcut to UninstallApp.exe and in properties of this shortcut in parameter 'arguments' insert value "/u=[ProductCode]".

6.Rebuild deployment project.Good luck ;)

Tuesday, August 5, 2008

Mapping USB to LPT1

Needed this for Zebra Label Printers (2844) in FLL that were USB.

net use lpt1: \\server\printer /Persistent:yes