473,396 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running application after installation

dreamfalcon
Hi!

I created a service, a windows form and a setup project in VB.NET.

And after install I need the installation directory to do something like this:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub ServiceProcessInstaller1_AfterInstall(ByVal sender As System.Object, ByVal e As System.Configuration.Install.InstallEventArgs) Handles ServiceProcessInstaller1.AfterInstall
  2.             Dim path As String = Me.TARGETDIR 'not working
  3.             If System.IO.File.Exists(path & "res.dll") Then
  4.                 Microsoft.VisualBasic.Shell("net start update_service")
  5.             Else
  6.                 Microsoft.VisualBasic.Shell(path & "activate.exe")
  7.             End If
  8.     End Sub
  9.  
The problem is how to get the installation dir?

Can anyone help me?
thx
Aug 21 '08 #1
3 1156
Please, anyone?
i'm stuck at this
Aug 23 '08 #2
hini
23
I am not sure if the value can be accessed directly from the classes of the solution, especially that it depends on the deployment application

you may try to search the installation directory by reading the windows registry using a code similar to this one :

RegistryKey bk = Registry.LocalMachine;
RegistryKey rk;
string subkey = @"System\CurrentControlSet\Services\yourservicenam e";
rk = bk.OpenSubKey(subkey);
MessageBox.Show(rk.GetValue("ImagePath").ToString( ));

this code searches for your service and gets the path of the exe that runs the service.
hope this will help.
Aug 24 '08 #3
...
you may try to search the installation directory by reading the windows registry using a code similar to this one :
...
It works.
Many thx :)
Aug 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dave A | last post by:
I have an application that runs in the system tray (taskbar notification area) and it runs at startup. Occasionally I need to release a new version. I have created a deployment project in .Net. ...
3
by: Chung Ley | last post by:
Hi I am having problem running an .net application on a Windows2000 Terminal Server. The application seems to work fine on user's desktop The issues that I have with running the application on...
5
by: Chris Dugan | last post by:
Hi, has anybody come across a solution to running an Access97 database on Windows XP. The situation I have is an Access 97 database that runs perfectly from Win95/98 clients running Access97, the...
3
by: Rune Jacobsen | last post by:
Hey all, Maybe someone knows this problem; I have a C# WinForms app that every now and then has a new version that I deploy to my users using an installation script written with the NSIS...
4
by: Jeremy S. | last post by:
We're in the process of writing a new Windows Forms app and the desktop support folks want for it to be run from a network share. I know it's possible (i.e., just have the framework on the clients...
3
by: Anil Kumar Sharma | last post by:
Hello, I am working on C# using vs.net 2003. I have faced two interesting problems. 1. Dynamically setting Default Button: I created a form and used it in various contexts. On basis of the...
1
by: Pieter | last post by:
Hi, Two VB.NET Windows Forms (2.0) applications had the same behaviour when they were run the first time by a user: after clicking on the shortcut, the location of the MSI-file is asked, and a...
2
by: salad | last post by:
Hi. I have some questions regarding the distribution and installation of an application. My current application is written in A97. I figure its time the application is upgraded to A2003 to...
4
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2 for a C# windows application. I'm preparing a installation package and I want to add the vcredist_86.exe to my installation. I add this exe file to my Application...
1
by: Cramer | last post by:
I'm running XP Pro/SP2 + patches and updates, with Visual Studio Professional 2008 (and no prior installation of Visual Studio ever installed). When attempting to open an ASP.NET Web application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.