|
What install method ? You say you're calling an install method, but you're talking about MSIs in a C# forum. So, are you using C# to write an MSI ? Are you calling some other sort of method, called install, that runs an MSI ? Are you talking about a C# program, or a process within the MSI ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
This is the code which i am talking about.. the position i mentioned in the code there i need to find the path for that specified file before calling that Configuration form .. i have to create MSI for my project..
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.IO;
using System.Reflection;
namespace Trade.CustomInstallation
{
[RunInstaller(true)]
public partial class CustomInstallation : Installer
{
public CustomInstallation()
{
InitializeComponent();
}
public override void Install(System.Collections.IDictionary stateSaver)
{
"Here I need to Check for the File "
ConfigurationForm frmConfig = new ConfigurationForm();
frmConfig.ShowDialog();
base.Install(stateSaver);
}
protected override void OnAfterUninstall(System.Collections.IDictionary savedState)
{
base.OnAfterUninstall(savedState);
//This method is used to delete all the files after uninstallation.
string rootPath = string.Empty;
string clientPath = string.Empty;
DirectoryInfo directoryInfo = Directory.GetParent(Assembly.GetExecutingAssembly().Location);
string currentDirectory = directoryInfo.ToString();
char[] separator = { '\\' };
string[] pathArray = currentDirectory.Split(separator);
//condition for Single drive like c:\
if (pathArray.Length == 2 && string.IsNullOrEmpty(pathArray[1]))
{
rootPath = currentDirectory + "Root";
clientPath = currentDirectory + "Client";
}
else
{
rootPath = currentDirectory + @"\Root";
clientPath = currentDirectory + @"\Client";
}
string[] subDirectories = Directory.GetDirectories(currentDirectory);
for (int subDirectoryCount = 0; subDirectoryCount < subDirectories.Length; subDirectoryCount++)
{
//Delete Root Folder
if (rootPath.Equals(subDirectories[subDirectoryCount]))
Directory.Delete(rootPath, true);
//Delete Client Folder
if (clientPath.Equals(subDirectories[subDirectoryCount]))
Directory.Delete(clientPath, true);
}
}
}
}
|
|
|
|
|
I didn't know you could write an msi in C#. So, all you need is System.IO.File.Exists to see if a file exists already ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,Friends i developed one application in C# win appl.
I used Globalization that i want to display all my lables,txtbox values,tabs in kannada.
but it working to labels that i am reading from resx.file.
But i am not getting to tabs,also store my txtbox values in access.
I am using Kannada Direct,MS access, problem is values in txtbox showing boxes.but it
storing kannada values in access.while retreving also it showing boxes.
please Help to come out.
|
|
|
|
|
I can vaguely understand this, but not well enough to know what you're asking....
What is Kannada Direct ?
Yathish hatter wrote: problem is values in txtbox showing boxe
Oh, OK. I think the problem is that the textbox is not using a font that includes the characters that are stored. So, you need to set the font of the textbox to one that can display those values.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Dear All,
I am want to change color of text or string through code in c #, I have a rich text box in which i fill data by for loop and i find that word which i want to change like word is Software and now i want to change its color like red and display in same rich text box code which i am using,
string[] strval;
strval = dr["bReceivedData"].ToString().Split(' ');
for (int i = 0; i < strval.Length; i++)
{
if (strval[i] == "Software")
{
abc = abc + strval[i];
txtcolor.Text = strval[i];
}
else
{
abc = abc + strval[i];
}
I get name successful now tell me please how can i change color of word and which technique is better for this, I thing dot net provides brush or some thing like that.
Kindly do replay.
Thanks
|
|
|
|
|
richTextBox.SelectionColor = Color.Red;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
hi here is my code in this i give the file name and sheet name and display the sheet in gride but my client want to open any excel file dynamically. Need a help,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Core ;
using System.Data.OleDb;
using Excel;
using System.Reflection;
using Microsoft.Office.Tools.Excel;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
Excel.Workbook wb;
Excel.Worksheet ws;
public Form1()
{
InitializeComponent();
//wb = new Excel.Workbook();
// ws = new Excel.Worksheet();
}
private void button1_Click(object sender, EventArgs e)
{
string filename = @"C:\mangesh1\mor\abc.xls";
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
//String connectionString="Provider=Microsoft.Jet.OLEDB.4.0;"+"Data Source="+filename +";"+"Extended Properties=Excel 8.0;";
OleDbCommand selectCommand = new OleDbCommand ("SELECT * FROM [sheet1$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand;
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
System.Data.DataTable dataTable = dataSet.Tables[0];
dataGridView1.DataSource = dataSet.Tables[0];
MessageBox.Show(dataGridView1.RowCount.ToString());
connection.Close();
/* openFileDialog1.ShowDialog();
openFileDialog1.ShowDialog();*/
// return sum;
// directorySearcher1.FindAll();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
//openFileDialog1.ShowDialog();
}
}
}
|
|
|
|
|
I want to download a file from server, I can do it with c# and webcliet method by connecting http
But What are the basic flow if I use HTTPS
Can you please give basics on how to connect and download files
If i use same code as HTTP connection, I am getting error like
Could not establish trust relationship for the SSL/TLS secure channel
Thanks in advance
PRabhakar
|
|
|
|
|
Hi
I am displaying a collection of objects in a datagridview by setting the datagridview's datasource to the collection property.
It works well, but now i want to display one of the properties as a combobox and not as a text field. I have found examples where one manually adds a new column and then setting it as a combobox, but nothing where the columns are automatically set from the properties of the object. Hope i make sense.
|
|
|
|
|
you have to manually add the ComboBox column.
try this
DataGridViewComboBoxColumn DGVcombo = new DataGridViewComboBoxColumn();
DGVcombo.HeaderText = "Combo Column";
DGVcombo.Name = "AnyName";
dataGridView.Columns.Add(DGVcombo);
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi Guru,
I'm a newbie in C#, as i know i can get the MSIHANDLE by call MsiOpenDatabase from Win32 SDK, can i call this function directly or there is a better way to get MSIHANDLE.
|
|
|
|
|
Your best bet is to p/invoke the Win32 call.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
As has already been said, you could use PInvoke. However, I think you could also add a COM reference to Microsoft Windows Installer Object Library and work from there (msi.dll or something like that)
|
|
|
|
|
I have a little app that will resize its main form when data is loaded. Sometimes I need to move the form so it remains entirely visible on the screen.
If the mouse cursor happens to be over a particular control when that happens I would like to move the mouse cursor so its position relative to the top left of that control remains constant. I can only seem to get the mouse location relative to the top left of the screen and I can only seem to get the control position relative to the top left of its parent.
Back in my MFC days there were two methods ClientToScreen and ScreenToClient that would convert between positions relative to the top left of screen and top left of the controls client area. Is there an equivalent in dot net?
|
|
|
|
|
Your control and window classes have a PointToScreen and PointToClient method.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a c# winforms app (must be a win app - responds to windows events) that accesses a web server side DB through a web app using a .ashx http handler that queries the DB into a dataset then coverts the dataset into XML and sends it back to the client.
My hosting service does not allow a remote DB connection (is this typical?) so I must do it this way.
Getting the server data into the client dataset is easy enough (ds.readXML) but is there an easy way to send back inserts/updates/deletes in the local dataset without coding all the SQL?
I know I can set up the generic insert/update/delete sql commands on the local DS but is there a way to get the actual resulting SQL statements and sent them to the server? or send the DS back as an object (the XML conversion loses the meta info on changed/inserted records)?
|
|
|
|
|
http://www.pcreview.co.uk/forums/thread-1237619.php[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thanks Xmen - but this is what I'm trying to avoid. I'm dealing with 5 or 6 tables and I was hoping to take advantage of the built in updating features of the DS as if it were local DS <-> local DB. It's early in development so I don't want to hard code field names for 5 tables. What I want to do just might not be possible.
|
|
|
|
|
did ya read full topic...I think there may be a solution
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
It's not exactly what I was looking for but it did lead me to Diffgrams (http://msdn.microsoft.com/en-us/library/ms172088(VS.80).aspx) which is exactly what I was looking for.
This converts the DS to XML including the DS meta data on updates/inserts/deletes
Thanks for the nudge in the right direction.
|
|
|
|
|
Hi, Sorry if i am posting in the wrng place, this is a general ques. I am doing an SMS application that communicates with the COM port, i want to use my O2 zinc phone as a modem, but whenever i connect the phone activesync use usb connection to connect, in the device manager also there is no COM port appear when i connect, so how can i use COM port with this O2 Zinc phone? (The cd comes with the phone also doesn't have any drivers for this purpose, internet also i searched and find no result . Please help me with this..
|
|
|
|
|
i used DSOFile to read and Write File Summary infor....it successfully can work... but i having a problem....i can run application only on my pc when i try to install in another PC. System asking to install OLEdocument.....etc.....is there got any way to slove this problem....either by change codes.....
here is my code...
foreach (ListViewItem item in listView2.SelectedItems)
{
FileInfo fileInfo = new FileInfo(item.Text);
string image = "C:\\PhotoManager\\" + fileInfo.Name;
DSOFile.OleDocumentPropertiesClass file = new DSOFile.OleDocumentPropertiesClass();
file.Open(image, false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
{
tbxFileName.Text = file.Name;
tbxTitle.Text = file.SummaryProperties.Title;
tbxSubject.Text = file.SummaryProperties.Subject;
tbxAuthor.Text = file.SummaryProperties.Author;
tbxKeywords.Text = file.SummaryProperties.Keywords;
tbxComments.Text = file.SummaryProperties.Comments;
file.Close(false);
}
}
A S E L A
modified on Monday, March 16, 2009 9:11 PM
|
|
|
|
|
I would assume that you have a reference to the DSO stuff in your project. Make sure it is marked "copy local" otherwise it will not be deployed.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have a ReadOnlyObservableCollection<t></t> being returned in an AsyncCompletedEventArgs derived object. Is there any way in the get; accessor to automatically pass it back to the original thread without having to use the Dispatcher in the callback method?
At the moment I'm doing this:
void SyncCompletedCallback(object sender, SyncJobCompleteCallbackEventArgs args)
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate
{
ReadOnlyObservableCollection<synceditem> history = args.SyncJobHistory;
HistoryView.ItemsSource = history;
});
}
</synceditem>
I'd rather let consumers have easy access to the collection like:
void SyncCompletedCallback(object sender, SyncJobCompleteCallbackEventArgs args)
{
HistoryView.ItemsSource = args.SyncJobHistory;
}
Thanks,
|
|
|
|