Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hopefully somebody can help me out here ... basically I am writing a deployment program and am using the path of the program that is executing in order to access the Folders containing data that I am passing as part of the deployment.

I was using the line

C#
myPath = Path.GetDirectoryName(Application.ExecutablePath);


but as that was failing I am now using this line

C#
myPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);


Both of these work just fine on my (Vista) Desktop & give me the exact path of the executing program. However, when I run the Setup on my (WinXP) laptop via a USB which is coming up as the E: drive, mySetup is NOT set to
E:\KAELC\mySetup
as I would expect, but it is set to (something like)
C:\Documents And Settings\Gary\Local Settings\Apps\2.0\GPACJD60.Z71\H0J8N8V7.3VK\kael..tion_b7e3cbeea3dd9a25_0001.000_ce512e4defa9e


Can somebody please explain how I get around this ?!?
Posted

Please, check whether the XP machine has any mapping network share with a drive name. If yes remove it and try it again.

For better understanding please refer to the following link

http://www.petri.co.il/control-usb-drive-letter-assignment-in-windows.htm[^]

If you feel this post was the exact thing which you were looking for your answer please mark it as answer.... :)
 
Share this answer
 
Hi senguptaamlan, thanks for the suggestion, but no, there is no mapping on the laptop, it's just a basic, new installation & it finds the USB as drive E: every time, it's just this path inside the program that is being "diverted" !!!

UPDATE ... I get the same problem on my son's Windows 7 laptop :-(
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900