|
You can't do this in Windows Explorer, so use any file manager (Far, Total Commander, NDN, etc). Find and rename the shortcut we've created earlier from "Uninstall.lnk" to, for example, "Uninstall.lnk.foo".
or
u can simply do this in command promt. juss naviage to that folder and use command:
ren uninstall.lnk uninstall.foo
and follow the remaining step
Thanx for this easier solution, it worked for me.
http://www.bilal.net.tc
|
|
|
|
|
You don't need to write code to parse the parameters and call msiexec...
1) n the Setup Project, View File System, and add a Special Folder - System Folder.
2) Into this folder Add a file. Browse for msiexec.exe from your local System32 folder and add it to the installation project. Override default properties of this file as follows... Condition:=Not Installed (make sure you put 'Not Installed' exactly like that, same case and everything), Permanent:=True, System:=True, Transitive:=True, Vital:=False.
3) Create a new Folder under the 'Users Program Menu' where you want the uninstall option to go.
4) Create a new shortcut in this new folder, and point it's at the msiexec.exe file in the System Folder as the target. Rename the shortcut to 'Uninstall MyApplication'.
Set the Arguments property to /x{space}[ProductCode].
5) Build the project, ignore warning about the fact that msiexec should be excluded, DONT exclude it or the setup project wont build.
The 'Not Installed' condition and Permananet:=True ensure that the msiexec.exe is only placed into the system folder as part of the install IF it doesn't aready exist, and it is not removed on an uninstall - therefore it;s pretty safe to ignore that warning and just go for it.
--------
SlapHead
|
|
|
|
|
The license for msiexec does not allow its distribution in this way. i.e. packaged in another installer. Msiexec should only be distributed as part of the Windows Installer 3.1 distribution. Whereas the method you have come up with should work, it is not legal. There is also the possibility that the user has a different version of msiexec already installed in their machine, and this might cause a version conflict.
|
|
|
|
|
You don't need to actually include msiexec, which is not legal as was pointed out.
You can just create a 0 byte file called msiexec.exe, include that, and then put it in the System Folder in the file system window.
This is the best and easiest way to create an Uninstall shortcut IMO.
|
|
|
|
|
Hi, i have problem with the solution given. i am a newbie in dot net. i have paste the coding given into my startup form (which is SplashScreen1.vb)
in SplashScreen1.Designer.vb, i add this code:
Sub New() 'i wrote this sub
Dim arguments As String() = Environment.GetCommandLineArgs()
Dim argument As String
For Each argument In arguments
If argument.Split("=")(0).ToLower = "/u" Then
Dim guid As String = argument.Split("=")(1)
Dim path As String = _
Environment.GetFolderPath(Environment.SpecialFolder.System)
Dim si As New ProcessStartInfo(path & _
" C:\Program Files\BSE 2008\Database\msiexec.exe", "/i " & guid)
Process.Start(si)
Close()
Application.Exit()
End
End If
Next
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<system.diagnostics.debuggerstepthrough()> _
Private Sub InitializeComponent()
......
End Sub
when i run the project, choose uninstall it gave me this error "(null) is not a valid win32 application"
what should i do? y is this happen?
tyia.
|
|
|
|
|
It appears that your code is trying to refer to a copy of msiexec which is in the program files folder. It should never be there. Msiexec is not licensed for separate distribution. But more importabtly you are concatenating path to the msiexec string. This is wrong. The code should be:
Dim si As New ProcessStartInfo(path & _
"\msiexec.exe", "/i " & guid)
This will concatenate the system path to the beginning of the msiexec path. Sinc you say you are a beginner you probably didn't realize that below is the same code:
Dim si As New ProcessStartInfo( _
path & "\msiexec.exe", "/i " & guid)
|
|
|
|
|
hi mjmeans,
i still cant running the uninstall part. i have changed the code as u mention before and it still produce me with the same result.
|
|
|
|
|
All I can think of is that maybe msiexec.exe is corrupt on your system, or you have some other msiexec.exe file that is not the real microsoft provided file somewhere in your system. Try downloading and installing an updated Windows Installer from Microsoft. When that is done, go to s command prompt and type "msiexec" and press enter. You should see a pop-up window with help parameters for msiexec. If you dont see this message, then your Windows system has problems that are preventing the code from working.
|
|
|
|
|
There is no need to call your application and encouter all these problems.
Create a Batch file say uninstall.bat with the following two lines:
@echo off
%Windows%\system32\msiexec.exe /x %1
Add an additional shortcut-link (to the batch file) in your deployment
Set the Arguments property to: [ProductCode] (just the poductcode without the /u=)
Set the ShowCmd to vsdscMinimized
finish
If you like to create a real Shortcut than you have to do some more.
Ref. to the articles: 'Conditional Install of Desktop and Quick Launch Shortcuts'
|
|
|
|
|
Hi. I like the sound of this solution however I can't get it to work. Precisely how do you add the batch file to the installer and shortcut it?
Here's what I tried:
Create the .bat file in notepad and save it to my project directory. Add the file directly to the Setup Project. Output the file to the application folder. Create a shortcut in a Programs Menu folder to the batch file in the application folder, setting the argument to [ProductCode], and so forth.
However when I run the install, although the shortcut appears in the start menu, and the batch file is properly installed to the application folder, the shortcut itself is blank (no target).
What am I doing wrong??
|
|
|
|
|
Aha, turns out the environment variable should have been %SystemRoot%, not %Windows%, at least for me, running WinXP SP2.
|
|
|
|
|
Hi,
I have created a MSI from multiple projects. Is it possible to uninstall the MSI with one unistall item added to the Program's Menu. If it is possibel thn can u let me know hw can i achieve this.
U can contact me on my email apondu@gmail.com
Thanks for ur help.
Regards,
Yachitha
hi
|
|
|
|
|
I tried your method -it's pretty good- but after uninstalling the app folder still exists. I guess the reason is that the uninstaller is being invoked from the app executable, so the folder is access-protected until the execution ends and uninstaller cannot remove it. (However, it does remove the executable itself... )
Any workaround for this? Thanks
Enric Carrión
|
|
|
|
|
I found it! I simply had to change the WorkingFolder of the shortcut to any different folder than the application directory (i.e. "User's Desktop").
Thank you anyway. Good job!
Enric
|
|
|
|
|
I have tried to do this. This don't work. I will glad an any help. Thanks.
|
|
|
|
|
Hi
Does anybody know answer to following problem.
Problem : I am creating deployment for C# apllication using dot net deployment & setup project.
I have created registry entries ( Ex. Server Name)and one edit dialog box for user input(Ex. IBM0505d-040). Now I want to write user input ( Ex.IBM0505d-040) as value of Server name registry entry at the time of installation.
Pls reply
Jitendra C.
|
|
|
|
|
Using registry is against .NET best practices. Try using configuration files, unless you need to maintain backward compatibility or you need to work in conjunction with another (old-fashioned) application that reads the data from registry.
|
|
|
|
|
Personnaly, I prefer to use the /x argument with Msiexec ... /i is for installing and when the software is already installed, it shows a dialog proposing to repair or uninstall your product. With the /x, it only asks for a confirmation.
See Msiexec arguments list[^] for more details.
|
|
|
|
|
:|The code don't work in web aplications.
Then, i create a new console project called UninstallProgram and add a class called UninstallClassP. After i program this code:
public static void Main(string[] args)
{
string[] arguments = Environment.GetCommandLineArgs();
foreach(string argument in arguments)
{
if (argument.Split('=')[0].ToLower() == "/u")
{
string guid = argument.Split('=')[1];
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo(path + @"\msiexec.exe", "/x " + guid);
si.UseShellExecute = false;
System.Diagnostics.Process.Start(si);
//Close();
//Application.Exit();
}
}
}
In my websetup project in FileSystem editor i add a primary output from UninstallProgram and I create a shortcut from this primary output.
After i select create a special Folder "User's Program Menu" and paste in it the shortuct created in previous step.
That's all.
Victor Velepucha.
MCSD.NET
|
|
|
|
|
... if you're designing for winxp logo compliance you shouldn't put the uninstall program on the start menu because add/remove in the control panel is where it's supposed to be cleaned up. IT's not an requirement at the moment, it's listed as a best practice in the section of planned future requirements.
|
|
|
|
|
This code does not eliminate the add/remove icon in control panel. It simply adds another way to uninstall the app. IIRC, logo compliance requires the uninstall to be in the control panel, but does not require it to be absent from the start menu.
|
|
|
|
|
You're right that it's not forbidden yet, but it's listed as a best practice in the section that's used to preview planned additions to the next version of the guide, and longhorn will be out before too much longer.
|
|
|
|
|
That's what I was just going to say ! The very first thought I had, even before I'd finished to read the title : "Isn't it against the Designed For XP logo ?"
Michael CARBENAY
Creo Ignem
|
|
|
|
|
I dont see anywhere that Windows XP logo compliance forbids a start menu uninstall entry, as long as the uninstall is ALSO in the control panel.
Regardless, the reasons why you might want to do this in addition to the normal add/remove icon is that A) many users expect to see it, and B) the uninstall process is far quicker on most machines in operation (most of which are 3-5 years old) than wading though control panel icons and waiting for the add/remove programs list to populate and calculate disk space usage for every application in its list before ever giving you the opportunity to uninstall.
Further, when doing support, it is far easier to instruct a computer novice to go to the uninstall entry right next to the application that they are familiar with in order to uninstall the application than into the control panel which they might never even known exists.
|
|
|
|
|
It's not a requirement, but it's in the Future requirement sections. F1.1 precisely states :
• Do not place shortcuts to remove the application in the Start menu. It is not needed because your application’s uninstaller is in the Add or Remove Programs Control Panel item.
but you're right, there's no need for doing so at this point. I suppose that "designed for hasta-la-vista baby" (oooopss...) will have this as a requirement.
Besides I have done enough user support to know that, basically, an untrained user will already have gone to the program files and deleted the folder (thanks to his son, nephew or any adolescent kid that he knows and who have said so) by the time he thinks about calling support.
That said, I still strongly find that your tip about how to do it is good, it's just that it should be pointed out that, if you're an hardcore microsoft-er, you should avoid making things that you'll have to remove in future version of windows and obviously things that Office don't do (ok, let's say that you shouldn't do a such componentized install : it makes the life of network-installed-office-user such a pain, but the rest sounds sensible).;P
Michael CARBENAY
Creo Ignem
|
|
|
|