|
Oh, I know it was only a typo. I just wanted to point out to Nnamdi (the original poster) that there was a typo so he wouldn't get confused (perhaps).
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
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.
Thanks in Advance
Karthik
|
|
|
|
|
Did you read this article[^] ?
It says "Remove the service. When you're done, use the Services dialog box to stop your service. Run InstallUtil with its /u parameter to uninstall your service. You'll also need to shut down the Windows Services applet to completely remove your service from memory.".
|
|
|
|
|
Yes it's working fine in development enviroment. Created the Microsoft Installer for Windows service by referring the link :
http://www.msdn.microsoft.com/library/en-us/dndba/html/DALGIssues.asp (Page# 12 to 14).
The problem is in Microsoft Installer. I run the setup package in the same development. Installation is working fine and installed the service automatically without using installutil feature. Before uninstalling using Add/ Remove program, Stopped the service, executed installutil/u and closed the Windows Service applet. And removed the application using Add/Remove program.
Later I customized the installation by adding one installer class. Pl refer the override method "Install" which I submitted in the previous mail. Created Microsoft installer and executed the setup in the same machine and service installed successfully.
Before uninstalling using Add/ Remove program, Stopped the service, executed installutil/u and got the error.
Thanks In Advance
Karthik
|
|
|
|
|
Nice work Rod, you've answered all queries on the frontpage of this forum keep it up...
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
thank Rod answered my questions
from fretre
|
|
|
|
|
Hello,
I need to write code to insert a user selected picture into a RichTextBox.
After checking the RTF file generated by WordPad, I found I can use the
following code to add a picture into RichTextBox:
string text = "";
text +=
"{\\rtf1\\ansi\\ansicpg936\\deff0\\deflang1033\\deflangfe2052{\\fonttbl{\\f0
\\fnil\\fcharset0 Microsoft Sans Serif;}}\n";
text +=
"\\uc1\\pard\\lang2052\\f0\\fs17{\\pict\\wmetafile8\\picwgoal480\\pichgoal24
0\n";
text += "............."; // data here
text += "\n}}";
richTextBox1.SelectedRtf = text;
But, I still do not know how to encodethe data field automatically.
Currently I can only paste it from the WordPad generated RTF.
Is there some easier way to let user select a bitmap file(bmp, jpg, etc.),
then insert it to the RichTextBox control?
Thank you very much,
weixiang
|
|
|
|
|
I personally would rely on the clipboard, ie load the image into the clipboard and use the RichTextBox.Paste(Format frmt) method to produce the stream.
This stream can then be saved to disk for reuse with RichTextBox.SaveFile(path) .
|
|
|
|
|
That's a good method. Thank you, .S.Rod
|
|
|
|
|
Hi,
Is there a way to run a program as a specified username? Just like RUNAS
command in windows?
Please help me.
Thanks.
|
|
|
|
|
If you can't find a specified function in the .NET doc, then consider using P/Invoke and realy on WIN32 functions instead (CreateProcessAsUser() seems to be the one useful in your case).
|
|
|
|
|
System.Diagnostics.Process p=new System.Diagnostics.Process();
p.StartInfo.FileName= "arj.exe ";
p.StartInfo.Arguments= "-x sourceFile.Arj c:\temp ";
p.Start();
if(p.HasExisted)
p.kill();
|
|
|
|
|
This indeed starts a process, but the question was to start a process under a given user profile, which is different.
|
|
|
|
|
Hi
Is there a new ECMA submission or spec. from MS for C# that covers the new 1.1 features?
Perhaps like 2001/2002 's version of the C# specification word doc from Anders H., et al...
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
SimonS wrote:
the new 1.1 features?
What features ?
Generics ? They are planned for Yukon.
|
|
|
|
|
There are very few language changes in 1.1.
IIRC, the ones that are there are to conform with the ECMA spec.
|
|
|
|
|
Could someone help me with sorting in treeview ? Exist something like callback function ?
Thanx
W.
|
|
|
|
|
First of all, set the System.Windows.TreeView.Sorted property to true.
Then, anytime you add a node, it calls the TreeNode.AddSorted(object) method instead of just adding it to the tail. The AddSorted(object) implementation has the compare function you can derive from and is as follows :
int AddSorted(TreeNode node) {
int local0;
int local1;
int local2;
int local3;
string local4;
CompareInfo local5;
local0 = 0;
local4 = node.Text;
if (this.childCount > 0) {
local5 = Application.CurrentCulture.CompareInfo;
if (local5.Compare(this.children[this.childCount - 1].Text, local4) <= 0)
local0 = this.childCount;
else {
local1 = 0;
local2 = this.childCount;
while (local1 < local2) {
local3 = local1 + local2 / 2;
if (local5.Compare(this.children[local3].Text, local4) <= 0) {
local1 = local3 + 1;
continue;
}
local2 = local3;
}
local0 = local1;
}
}
node.SortChildren();
this.InsertNodeAt(local0, node);
return local0;
}
|
|
|
|
|
hi,
Is it possible to get mouse and key event that owned by other application?
is there anyway in c#?
thank a lot
|
|
|
|
|
|
I'm getting the following error message:
the DB2OLEDB provider is not registered on the local machine.
from where can I download this driver on the web?
Jassim Rahma
|
|
|
|
|
You've got to download[^] the IBM client software.
|
|
|
|
|
I am having a problem with one event consuming two other events. I.e. I have a ListView with a DoubleClick event and a ContextMenu . When I add a mouseDown event for drag and drop operations, the DoubleClick event no longer fires and the ContextMenu opens only on occasion.
Any Ideas?
|
|
|
|
|
Provide implementation for the OnItemDrag event handler instead.
|
|
|
|
|
Thanks
|
|
|
|