I got the following error while executing the installutil/u MyFile.exe. Refer the steps below:
---------------------------------------------------------------------------------------------------------------------------
Affected parameters are:
assemblypath = d:\test\filewatcher.exe
logfile = d:\test\filewatcher.InstallLog
An exception occurred during the uninstallation of the FileWatcher.SetupInstaller installer.
System.NullReferenceException: Object reference not set to an instance of an object.
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be
fully uninstalled after the uninstall is complete.
Removing EventLog source OFACFolderWatchService.
Service OFACFolderWatchService is being removed from the system...
Service OFACFolderWatchService was successfully removed from the system.
Detailed Steps:
I developed FileWatcher windows service using C# and created Microsoft Installer. Installation and Uninstallation was working fine.
Later I customized the Microsoft Installer by adding one Installer class (SetupInstaller.cs) to my existing FileWatcher project.
Added the Override method of base Class as:
public override void Install(System.Collections.IDictionary PassData)
{
//update the XML File
string strAppPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
strAppPath = strAppPath.Substring(0,strAppPath.LastIndexOf("\")+1);
string strXMLFile = strAppPath + "OFACTracker.xml";
XmlDocument objXMLDocument = new XmlDocument();
string strNodeValue = "";
try
{
objXMLDocument.Load(strXMLFile);
XmlNodeList objNodeList = objXMLDocument.GetElementsByTagName("InBox");
strNodeValue = strAppPath + "Inbox";
objNodeList.Item(0).FirstChild.Value = strNodeValue;
objXMLDocument.Save(strXMLFile);
}
catch(Exception)
{
//Exception Handling
}
}
Note:
ProjectInstaller.cs already exist while creating the service. I didnt touch this installer class.
Created Setup Package. Here I added Project group to an Application Folder of System Editor and Added custom Action to an Install Node.
In this case Installation was working file (Service registered automatically). Before Unstallation, executed Installutil/u FileWatcher.exe and got the above
error.
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).