468,306 Members | 1,138 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,306 developers. It's quick & easy.

Setup Program (query 2)...

Hi Cor:

You have given a very good suggestion that I can directly reference the
"Program Files" Folder. Actually my vb.net program reads/write a notepad
file record.txt. For example, the name of my program is MYPROGRAM and I am
presuming that it would be installed in the "MYPROGRAM" folder of "Program
Files". Therefore I can reference record.txt file in my code as

path = Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
path = path & "\MYPROGRAM\record.txt"
.......
.......

So far so good.

Now my question is what's the guarantee that user is going to install that
program in "Program Files" directory ? What if during the installation user
install that in C:\ ? Then my program would be installed at C:\MYPROGRAM and
my code would be searching the .txt file as "C:\Program
Files\MYPROGRAM\record.txt".

In simple words, what's the way to force the user to install MYPROGRAM in
Program Files directory.

Thanks in advance!


*********************

PREVIOUS REPLIES & QUESTIONS...
************************************************** ************

Hi Don,
It is easy to find the program-files directory, maybe you can use that in
your program, so there is no need for hardcoding the program directory.
And now I in doubt which it is :-)
\\\\
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
Environment.GetFolderPath(Environment.SpecialFolde r.Programs)
////
But I think that is easy to find for yourself which one if you know the
trick?

Cor

***** FIRST QUERY::::
I am working on the setup project of my small vb.net program. I don't want
to give the user (the person who will install my program) an option where
(s)he wants to install the program/utility. For example it should only be
installed only in C:\NEWPROGRAM directory. Please tell me in simple steps..

Thanks in advance!
Nov 20 '05 #1
4 1121
Hi Don,

!! .. force the user .. !!

Aaaggh!!

As a User I hate not being given the choice of where to install some
software. I don't always use Program Files (eg, games go on a different drive)
and I frequently reduce a long-winded app name to something shorter.

Is there a way for the Setup to write a registry key for you which records
the installation path? You may allow the User to choose where to install but
they can't expect to control your registry keys.

On the other hand, if you want your application to know where it's being
run from, it already knows:
Application.ExecutablePath
This includes the program name and extension so you'd have to remove those
first.

Regards,
Fergus
Nov 20 '05 #2

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Hi Don,

!! .. force the user .. !!

Aaaggh!!

As a User I hate not being given the choice of where to install some
software. I don't always use Program Files (eg, games go on a different drive)
and I frequently reduce a long-winded app name to something shorter.
I agree, and on top of that, I commonly install programs on a different drive entirely, D:, or
maybe F: or G: who knows.
Is there a way for the Setup to write a registry key for you which records
the installation path? You may allow the User to choose where to install but
they can't expect to control your registry keys.

On the other hand, if you want your application to know where it's being
run from, it already knows:
Application.ExecutablePath
This includes the program name and extension so you'd have to remove those
first.
Regards,
Fergus

Nov 20 '05 #3
You are great. Good suggestion. Thanks.

I found the another method where even there is no need to cut the extension
and it is:
Application.Startup Path

There is one more problem I am facing but didn't get the solution. In my
Setup Program I am not been able to create 2 things (when the program is
intalled on the client machine ) : (1) create shortcut to my program/utility
(2) Entry in Windows' Start --> Program Menu.

Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2)
MYPROGRAM_INSTALLER. MYPROGRAM is a "Windows Application".
MYPROGRAM_INSTALLER is a "SetUp Wizard" project.

Although on "File System Editor" in the Solution Explorer I can see (1)
Application Folder (2) User's Desktop and (3) User's Program Menu. But some
how I am not been able to create short cuts for Start Menu and Users'
Desktop. May be you can tell me in simple steps....

- Sender

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Hi Don,

!! .. force the user .. !!

Aaaggh!!

As a User I hate not being given the choice of where to install some
software. I don't always use Program Files (eg, games go on a different drive) and I frequently reduce a long-winded app name to something shorter.

Is there a way for the Setup to write a registry key for you which records the installation path? You may allow the User to choose where to install but they can't expect to control your registry keys.

On the other hand, if you want your application to know where it's being run from, it already knows:
Application.ExecutablePath
This includes the program name and extension so you'd have to remove those first.

Regards,
Fergus

Nov 20 '05 #4
Hi Don,

I'm afraid I've not been involved with the Setup Wizard so far. If no-one
else picks up on this, you may need to post it as an independant query.

Sorry. :-(

Regards,
Fergus
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by I_AM_DON_AND_YOU? | last post: by
7 posts views Thread by Bob | last post: by
8 posts views Thread by pamelafluente | last post: by
reply views Thread by Will Asrari | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.