Board index » Visual Studio » How to find default Installation Folder of an application?

How to find default Installation Folder of an application?

Visual Studio53
Hello,



How can I find in which folder the apllication is installed?

It is generally installed in X:\Program File\folder_name.

(X: is system drive)

I am trying to trap this folder for a follwing reason:

I developed a VB6 application and installed it on near about 50 machines.

Now if I make some changes to program, I have to copy a new .exe to each

machine manualy.

For this I added some code to application and replaced the .exe on all

machines.

This code look for a new .exe on a file server and if needed changes with it

self.

This is working very fine. (I'LL LIKE TO KNOW, IF ANY OTHER WAY IS THERE?)



But the my problem is that on some machines the OS is installed on C: , on

some it is D: and so on.

Even worse the application is not installed to its default

location(X:\Program File\folder_name)



So my new code needs the location where the application is installed.



How can i do it? Any api function?

I tried for GetSysInfo. It dose not help me. And I have never worked on

registry settings..





--

Regards,

Amit Mohod

AB Softskills, Nashik.

Cell No: 09822939505

Office: +91-253-2382781(255)


-
 

Re:How to find default Installation Folder of an application?

"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message



Quote
How can I find in which folder the apllication is installed?



Have a look at the App.Path property.



Mike









-

Re:How to find default Installation Folder of an application?

"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message



. . . hey, that was good! You got your answer eight minutes before you asked

your question ;-)



My clock is about a minuute slow, so I imagine that your's is about seven

minutes fast.



Mike







-

Re:How to find default Installation Folder of an application?



Thanks



How stupid one can be??? Just absent mindness..

--

Regards,

Amit Mohod

AB Softskills, Nashik.

Cell No: 09822939505

Office: +91-253-2382781(255)

"mike williams" <mike@whiskyAndCoke.com>wrote in message

Quote
"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message

news:uVPJmZb8FHA.3660@TK2MSFTNGP09.phx.gbl...



>How can I find in which folder the apllication is installed?



Have a look at the App.Path property.



Mike













-

Re:How to find default Installation Folder of an application?

lol



--

Regards,

Amit Mohod

AB Softskills, Nashik.

Cell No: 09822939505

Office: +91-253-2382781(255)

"mike williams" <mike@whiskyAndCoke.com>wrote in message

Quote
"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message

news:uVPJmZb8FHA.3660@TK2MSFTNGP09.phx.gbl...



. . . hey, that was good! You got your answer eight minutes before you

asked

your question ;-)



My clock is about a minuute slow, so I imagine that your's is about seven

minutes fast.



Mike











-

Re:How to find default Installation Folder of an application?

"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message



Quote
Thanks How stupid one can be??? Just absent mindness..



Don't worry about it Amit. When you get to my age, absent mindedness is par

for the course ;-)



Mike









-

Re:How to find default Installation Folder of an application?

"mike williams" <mike@whiskyAndCoke.com>wrote:



Quote
"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message

news:uVPJmZb8FHA.3660@TK2MSFTNGP09.phx.gbl...



>How can I find in which folder the apllication is installed?



Have a look at the App.Path property.



Mike









How does that help?



App.path show where the current exe is running, but he needs (as I

understood the OP) to know where the previously installed copy of the

app is stored.



I would suggest the app makes a registry setting saving its install

folder, and any subsequent installer look for that setting in the

registry.



-mhd

-

Re:How to find default Installation Folder of an application?

"-mhd" <not_real@invalid.com>wrote in message



Quote
How does that help? App.path show where the current exe

is running, but he needs (as I understood the OP) to know

where the previously installed copy of the app is stored.



If that's the case then I've misread his question.



Mike









-

Re:How to find default Installation Folder of an application?



"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message

Quote
Hello,



How can I find in which folder the apllication is installed?

It is generally installed in X:\Program File\folder_name.

(X: is system drive)

I am trying to trap this folder for a follwing reason:

I developed a VB6 application and installed it on near about 50 machines.

Now if I make some changes to program, I have to copy a new .exe to each

machine manualy.

For this I added some code to application and replaced the .exe on all

machines.

This code look for a new .exe on a file server and if needed changes with

it

self.

This is working very fine. (I'LL LIKE TO KNOW, IF ANY OTHER WAY IS THERE?)



But the my problem is that on some machines the OS is installed on C: , on

some it is D: and so on.

Even worse the application is not installed to its default

location(X:\Program File\folder_name)



So my new code needs the location where the application is installed.



How can i do it? Any api function?

I tried for GetSysInfo. It dose not help me. And I have never worked on

registry settings..





--

Regards,

Amit Mohod

AB Softskills, Nashik.

Cell No: 09822939505

Office: +91-253-2382781(255)







In addition to the others suggestions...

If you used Setup or one of the other packaged programs (Inno,

InstallShield, ...) you should also have created an uninstall

file/log/script. If so it will be found at ...

\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

under your programs name. The path to your uninstall should be the

UninstallString key.



Also it never hurts to have your application during an install or at first

running to write to Hlocal_Machine\Software\<my company>\<my

program>\<data>\<here I am>



-ralph









-

Re:How to find default Installation Folder of an application?

You need to have the application to save a file with

its path in the Windows Directory or the root drive C.

Unless there is a way Getsetting can access a network

computer registry. For that your app should save its

path in the registry Example:



Dim iCheckPath, f$

f$ = App.Path

iCheckPath = GetSetting("ProgramName", "Config", "InstPath")

If Len(iCheckPath) = 0 Then

SaveSetting "ProgramName", "Config", "InstPath", f$

End If





"Amit Mohod" <amitmohod_REMOVE_THIS_STUFF@msn.com>wrote in message

Quote
Hello,



How can I find in which folder the apllication is installed?

It is generally installed in X:\Program File\folder_name.

(X: is system drive)

I am trying to trap this folder for a follwing reason:

I developed a VB6 application and installed it on near about 50 machines.

Now if I make some changes to program, I have to copy a new .exe to each

machine manualy.

For this I added some code to application and replaced the .exe on all

machines.

This code look for a new .exe on a file server and if needed changes with

it self.

This is working very fine. (I'LL LIKE TO KNOW, IF ANY OTHER WAY IS THERE?)



But the my problem is that on some machines the OS is installed on C: , on

some it is D: and so on.

Even worse the application is not installed to its default

location(X:\Program File\folder_name)



So my new code needs the location where the application is installed.



How can i do it? Any api function?

I tried for GetSysInfo. It dose not help me. And I have never worked on

registry settings..





--

Regards,

Amit Mohod

AB Softskills, Nashik.

Cell No: 09822939505

Office: +91-253-2382781(255)







-