473,666 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Distributing application

Q
Hello you all,

I have created an application that reads and writes data to a access
database.
To access the database, I use a System DataSource (Connection string:
DSN=MyDataSourc eName).

If I distribute my application, there is a possibility to add the registry
key for the system datasource so that the
System DataSource will be created on the machine where the application is
being installed.
The problem here is that the path to the database can be different than the
original path on the developers machine.
(the path depends on the installation folder the user selects!!)
Is there a way to solve this problem???
Can you refer to the application folder in the registry entry?

Any help would be appriciated!

Thanks

Q
Nov 21 '05 #1
7 1572
Hi Q,
You can access the registry using the RegistryKey class found in the
Microsoft.Win32 namespace.
I suggest reading the msdn help page at
http://msdn.microsoft.com/library/de...classtopic.asp.
It contains plenty of examples of how to read values from the registry.

Hope this helps,
Phil Harvey

----------
http://spaces.msn.com/members/dotnetspace
Nov 21 '05 #2
Sorry I just re-read your question and realised my answer wasn't too helpful :s

"Phil Harvey" wrote:
Hi Q,
You can access the registry using the RegistryKey class found in the
Microsoft.Win32 namespace.
I suggest reading the msdn help page at
http://msdn.microsoft.com/library/de...classtopic.asp.
It contains plenty of examples of how to read values from the registry.

Hope this helps,
Phil Harvey

----------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #3
Q
Yes Phil,

I think you misunderstood the question.
I simply want the setup of my application to do the job, so that the user
who installs the application doesn't
have to worry about the location of the database.

Thanks for the suggestion anyway,

Q
"Phil Harvey" <Ph********@dis cussions.micros oft.com> wrote in message
news:61******** *************** ***********@mic rosoft.com...
Hi Q,
You can access the registry using the RegistryKey class found in the
Microsoft.Win32 namespace.
I suggest reading the msdn help page at
http://msdn.microsoft.com/library/de...classtopic.asp.
It contains plenty of examples of how to read values from the registry.

Hope this helps,
Phil Harvey

----------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #4
Use Application.Sta rtupPath Property

"Q" wrote:
Can you refer to the application folder in the registry entry?


Nov 21 '05 #5
Q,

Yes you can easily acheive this. The more standard way would be to create an
MSI installer. You can then use a class that inherits from
System.Configur ation.Install.I nstaller and write code in C# or VB.NET that
allows you to customize the install process to your heart's content.

My recommendation would be to store stuff in the application.con fig file
rather than the system registry because for security reasons there's a (good
or bad) push towards letting the average joe user run his machine as a
non-admin, and to qualify for "Runs on Windows XP" label, your app must be
able to run without running as admin - i.e. it cannot access registry.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik

"Q" <Q@nomail.be> wrote in message
news:uH******** ******@TK2MSFTN GP10.phx.gbl...
Hello you all,

I have created an application that reads and writes data to a access
database.
To access the database, I use a System DataSource (Connection string:
DSN=MyDataSourc eName).

If I distribute my application, there is a possibility to add the registry
key for the system datasource so that the
System DataSource will be created on the machine where the application is
being installed.
The problem here is that the path to the database can be different than the original path on the developers machine.
(the path depends on the installation folder the user selects!!)
Is there a way to solve this problem???
Can you refer to the application folder in the registry entry?

Any help would be appriciated!

Thanks

Q

Nov 21 '05 #6
Q
Hey Rulin,
Thanks for your reply but:

How can you use "Application.St artupPath" in the setup of the application?

I'm not sure if you understood my problem:

I just want the DataSource to be created in the Registry during the
installation of my application. The problem here is that
the path to the database (which has to be included in the DataSource)
depends on the location where the user installs the
application.
I know that you can create Registry-entries from within the setup of an
application but according to me, this only works
with predefined values. (e.g. you can say that
DBQ=c:\Installa tion_Directory\ Database\Mydata base.mdb).
The problem here is that the information provided here is not valid if the
user decides to install the application in another directory.
Is there a way to change this value
(c:\installatio n_directory\dat abase\mydatabas e.mdb) to the valid value?

Thanks,

Q

"Rulin Hong" <Ru*******@disc ussions.microso ft.com> wrote in message
news:26******** *************** ***********@mic rosoft.com...
Use Application.Sta rtupPath Property

"Q" wrote:
Can you refer to the application folder in the registry entry?

Nov 21 '05 #7
Sahil Malik wrote:
My recommendation would be to store stuff in the application.con fig file
rather than the system registry because for security reasons there's a
(good
or bad) push towards letting the average joe user run his machine as a
non-admin, and to qualify for "Runs on Windows XP" label, your app must be
able to run without running as admin - i.e. it cannot access registry.


I don't think that's quite correct. As a non-admin, you are allowed to make
changes that just affect you, but you can't make system wide changes (that
requires admin rights). In particular, you can make changes to the registry
under HKEY_CURRENT_US ER (and read from HKEY_LOCAL_MACH INE).

As for the config file, this is always stored in the same folder as the
running application. However, non-admin users can't make any changes under
C:\Program Files (to avoid the problem where a virus gets onto your machine,
and infects every other installed application). So, certainly don't put your
database there (as Rulin Hong suggested). If you know that the database
won't move after the application is installed, then storing the location in
the config file would work.

In a more general case (like the MRU list of databases in Access), the
user's section of the registry would be a good place to store the list. You
can also store user-specific information in their profile, e.g. C:\Documents
and Settings\John\A pplication Data\<my company>\<my app>

I certainly agree that it's a good idea to develop applications that don't
require admin rights, and I think that the best way to achieve this is for
you (as a developer) not to have admin rights on your machine; keep a
separate login account for times when you need to install software etc. I've
been doing that for the last few months, and it's working well for me.

John
Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2155
by: Rick | last post by:
Hi all, I am writing a small PHP accounting and office management application and would like to learn how to "package" it for distribution. It requires the use of a small MySQL database which is my main concern. How do I distribute that...and insure that it can be used, i.e., having the proper MySQL services running. Any comments or direction to sources of info will be greatly appreciated... Thanks in Advance,
1
1288
by: Greg Smith | last post by:
I am distributing a Windows application via a Setup.exe file. How do you change the default target folder that comes up in the "Select Installation Folder" dialog box. Any help is greatly appreciated.
2
1729
by: David | last post by:
I have been going around in circles trying to understand the method of creating a database in VB.Net 2003 and distributing that application and database. It seems if I use the Server Explorer to create the pledbConnection etc, the link to the database works ok on the local machine but when the application is distributed, the program points to the original path (which of course is different to the target system). Is there any way to...
10
7414
by: John Phelan | last post by:
I read an article by, by Mike Groh, in Access-VB-SQL Advisor Magazine, Week 37 that concerns me quite a bit on distributing Access Applications commercially. First I need to describe a "commercial version" of my application that I hope to distribute after completing all the beta testing: A. It was developed using MS AccessXP Pro (developers edition), B. It has a front end MyApplication.mdb and a MyAppBbackend_be.mde; the front end is...
2
1789
by: John Welch | last post by:
It happens much too often that I have to tell a client how to fix up missing references when I send them an application, especially if the client is distributing it to different users. It makes me look unprofessional (which I guess I am to some extent). I've tried the fixuprefs() function I got from the knowledge base (that uses the qryTestRefs and checks for error 3075), but it doesn't seem to get called, and I still get the problem. I'm...
0
1527
by: news.microsoft.com | last post by:
Hi everyone, I am using the MSComm32.ocx in my application. Visual Studio itself created an Interop wrapper dll and included the ocx in the application directory. I packaged these when creating my setup project for the application. However, on the target machine, when the application is run and the MSComm32 lib is referenced - it gives an error saying "class is not licensed for use".
0
1824
by: BallCOMET | last post by:
I have an application that I built with Visual Studio 2005 and for which I enabled OpenMP. If I open the compiled binary in Visual Studio, this is the manifest that is embedded in the executable as RT_MANIFEST entry 1: <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86"...
9
2029
by: alf | last post by:
Hi, I have a small app which consist of a few .py files. Is there any way to distribute it in jar like fashion as a single file I can just run python on. I obviously look for platform independent solution. Thx in advance, A.
1
1410
by: PurpleServerMonkey | last post by:
Working on a rather large open source python application that I want to release for Linux and BSD and was wondering what methods others are using to distribute large and complex applications. Setuptools and friends seem to be focused on distributing modules, I'm at the other end of the scale where I want to distribute an entire application so that an Administrator can run a single install and have a fully operational product. A key...
9
1502
by: eliben | last post by:
Hello, I'm getting into Python now after years of Perl, and as part of my research I must understand how to do some common tasks I need. I have a bunch of Windows PCs at work to which I want to distribute an application I've developed on my PC. All these PCs have Python 2.5 installed. If my application contains only code I've developed, I simply zip its
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8869
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.