Setup Program (query 2)...

  • Thread starter Thread starter I_AM_DON_AND_YOU?
  • Start date Start date
I

I_AM_DON_AND_YOU?

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.SpecialFolder.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.SpecialFolder.ProgramFiles)
Environment.GetFolderPath(Environment.SpecialFolder.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!
 
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
 
Fergus Cooney said:
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.
 
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
 
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
 
Back
Top