473,405 Members | 2,338 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,405 software developers and data experts.

How to change defaultLocation based on the OS

14
I have a windows application using .net 1.1

In the setup project I set the DefaultLocation to
[ProgramFileFolder][Manufacturer]ABC

Is there a way to change this defaultLocation based on the OS.
I'd like to leave this location when installing on Windows XP but change the location to another path when installing on Windows Vista.

Can I use an If-statement to determine the OS and then set the DefaultLocation?
Dec 30 '08 #1
8 4229
SammyB
807 Expert 512MB
@David R
Yes, just look at Environment.OSVersion and set Environment.CurrentDirectory

HTH --Sam
Dec 30 '08 #2
David R
14
I guess I don't know where to do this
Dec 30 '08 #3
SammyB
807 Expert 512MB
What language are you using (C# or VB)? What sort of app (Windows or ASP)? In any case, you'll want to put it first thing: probably in the form load event, assuming that you have a form.
Dec 30 '08 #4
David R
14
Its a Windows app, C#. .net 1.1
No, I do not have a form load event
Dec 30 '08 #5
SammyB
807 Expert 512MB
>No, I do not have a form load event
Does your app have a form? If so, just double-click on the form in the designer & you will have the outline for the load event. If not, what code gets executed first? can't you put it there?
Dec 30 '08 #6
David R
14
I guess I'm not understanding.
I have 2 projects in my solution. One is the application itself, the second is the setup project.
In the setup project I setup the application folders to be created during the installation.
A property of the Application Folder is "DefaultLocation" where I have it set to "[ProgramFilesFoler][Manufacturer]\ABC"

How do I change this location based on the OS during setup?
Jan 15 '09 #7
David, Did you ever figure out how to do this?
I need to do this as well...change the DefaultLocation during installation based on OS.
Mar 23 '10 #8
MrMancunian
569 Expert 512MB
Add an Installer Class to your project (not in the setup). In this class, you override the Sub Install. In this class, you change the default installation location. Build your project! Now, in your Setup project, you add a Custom Action to the Install and choose the Primary output of the other project. That should do the trick.

Steven
Mar 24 '10 #9

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

Similar topics

6
by: Dave C. | last post by:
Hello, I have created the following trigger: CREATE TRIGGER tr_UDFTest ON UserDefinedFields FOR INSERT, UPDATE AS DECLARE @foobar varchar(100) SELECT @foobar= foobar FROM inserted IF (...
12
by: techie | last post by:
Hi All, I have a portal working on an intranet for a company. The portal was designed keeping in mind the resolution of 1024*768. I am including a ..css file in all the files. Now i have to make...
0
by: smHaig | last post by:
The default location for a installed program is \. Since this is not a hardcoded path, I don't know how to change it to the what I want. I don't want the company name as a folder and the...
3
by: dataguy | last post by:
I can't find it anywhere in the manual, but I have a developer that wants to know if we can code a trigger to capture the data that has changed in a table only if certain columns have changed. It...
2
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a...
8
by: lauren quantrell | last post by:
When I open an Access form I can have no recordset specified, then in the form's OnOpen event I can do something like: Me.paramaters = "@SomeColumn = 22)" Me.recordsource = "dbo.sproc123" But I...
1
by: Georges Bessis | last post by:
Hi, In an existing Deployment project, I want to modify the Product Name, Manufacturer Name, and the DefaultLocation of the Application Directory. I cant see where this can be done. Could you...
11
by: free4trample | last post by:
First of all let me say that I know very little about javascript. what i need to do is to write a javascript functin which will change the background color of the table rows based on entrees in...
0
by: Scott Abel | last post by:
Tuesday, December 12, 2006 -- 10:00AM EST / 3:00 PM GMT X-Pubs presents: CMS & Change - Love it, Hate it, Master it (Scott Abel & Emma Hamer) Reserve your Webinar seat now at:...
4
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.