Click here to Skip to main content
15,891,880 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: how do I know which button was clicked Pin
EliottA18-Jan-10 10:31
EliottA18-Jan-10 10:31 
GeneralRe: how do I know which button was clicked Pin
Luc Pattyn18-Jan-10 10:50
sitebuilderLuc Pattyn18-Jan-10 10:50 
GeneralRe: how do I know which button was clicked Pin
spawneditions18-Jan-10 12:03
spawneditions18-Jan-10 12:03 
GeneralRe: how do I know which button was clicked Pin
Luc Pattyn18-Jan-10 12:15
sitebuilderLuc Pattyn18-Jan-10 12:15 
GeneralRe: how do I know which button was clicked Pin
spawneditions18-Jan-10 12:24
spawneditions18-Jan-10 12:24 
GeneralRe: how do I know which button was clicked Pin
spawneditions18-Jan-10 12:12
spawneditions18-Jan-10 12:12 
GeneralRe: how do I know which button was clicked Pin
Luc Pattyn18-Jan-10 10:49
sitebuilderLuc Pattyn18-Jan-10 10:49 
QuestionXML file not written in intended directory Pin
Paul Hasler17-Jan-10 18:52
Paul Hasler17-Jan-10 18:52 
First off, please forgive me if this is in the wrong section. I'm not sure if the probelm is my VB.Net code or my understanding of installers.

I've written a Windows Forms Application which stores it's preference settings in an XML file. I'm having problems with the file not being written to the directory I intend.

I want to write the XML file in the application folder C:\Program Files\MyApplication, but when I install and then run my application it writes the XML file in C:\Users\MyAccount\AppData\Local\VirtualStore\Program Files\MyApplication (This folder does not contain a copy of the executable, and is empty apart from the files written by my application when it runs).

I've made the following declarations in the application for the file name and path:
Private strApplicationPath As String = Application.StartupPath
Private strPreferencesFileName As String = "\Preferences.ini"

I have my application preferences stored in a DataSet called dsPreferences, and use the following code to write the file:
dsPreferences.WriteXml(strApplicationPath & strPreferencesFileName, XmlWriteMode.WriteSchema)

To help me sort out what's going on I've also added a lable to the form called lblPath to display the file name and path:
lblPath.Text = strApplicationPath & strPreferencesFileName

When I do a Release Build, and run the executable everything seems to work fine. The XML file is written in the same directory as the executable ie
C:\Projects\MyApplication\bin\Release
and lblPath.Text also displays
C:\Projects\MyApplication\bin\Release

HOWEVER!
I then use "Inno Setup 5" and "ISTool" to create an installer, and then install the application to
C:\Program Files\MyApplication.
Now when I run the application the XML file is written to
C:\Users\MyAccount\AppData\Local\VirtualStore\Program Files\MyApplication
instead of
C:\Program Files\MyApplication
where the executable is, even though lblPath.Text still shows that
strApplicationPath & strPreferencesFileName = C:\Program Files\MyApplication
!?! Confused | :confused:

The same issue is happening with the SqlCe database file for the application.

- What is this VirtualStore?

- Why is the XML file written there when I've been reasonably explicit that it should be stored in the same folder as the executable?

- How can I make sure the file gets written to the correct folder?

Thanking you in advance.

Paul
AnswerRe: XML file not written in intended directory Pin
Garth J Lancaster17-Jan-10 20:36
professionalGarth J Lancaster17-Jan-10 20:36 
GeneralRe: XML file not written in intended directory Pin
Paul Hasler18-Jan-10 0:30
Paul Hasler18-Jan-10 0:30 
QuestionI was thinking that the result of 50\1000 was 0.05 ........ Pin
Hurricane300017-Jan-10 6:25
Hurricane300017-Jan-10 6:25 
AnswerRe: I was thinking that the result of 50\1000 was 0.05 ........ Pin
dan!sh 17-Jan-10 6:47
professional dan!sh 17-Jan-10 6:47 
GeneralRe: I was thinking that the result of 50\1000 was 0.05 ........ Pin
Hurricane300017-Jan-10 7:49
Hurricane300017-Jan-10 7:49 
AnswerRe: I was thinking that the result of 50\1000 was 0.05 ........ Pin
Dave Kreskowiak17-Jan-10 8:58
mveDave Kreskowiak17-Jan-10 8:58 
GeneralRe:[SOLVED] I was thinking that the result of 50\1000 was 0.05 ........ Pin
Hurricane300017-Jan-10 10:06
Hurricane300017-Jan-10 10:06 
GeneralRe: I was thinking that the result of 50\1000 was 0.05 ........ Pin
Dalek Dave18-Jan-10 3:48
professionalDalek Dave18-Jan-10 3:48 
QuestionCustom Skins/Themes for VB .NET application. Pin
jeshra27917-Jan-10 5:27
jeshra27917-Jan-10 5:27 
AnswerRe: Custom Skins/Themes for VB .NET application. Pin
Eddy Vluggen18-Jan-10 7:43
professionalEddy Vluggen18-Jan-10 7:43 
QuestionHow to print directly crystal report other than Crystalreportviewer? Pin
Paramu197317-Jan-10 3:08
Paramu197317-Jan-10 3:08 
AnswerRe: How to print directly crystal report other than Crystalreportviewer? Pin
Mycroft Holmes17-Jan-10 14:40
professionalMycroft Holmes17-Jan-10 14:40 
AnswerRe: How to print directly crystal report other than Crystalreportviewer? Pin
Steven J Jowett18-Jan-10 8:02
Steven J Jowett18-Jan-10 8:02 
QuestionNeutralize click event on Tab Pin
tannghia16-Jan-10 23:28
tannghia16-Jan-10 23:28 
AnswerRe: Neutralize click event on Tab Pin
dan!sh 16-Jan-10 23:58
professional dan!sh 16-Jan-10 23:58 
GeneralRe: Neutralize click event on Tab Pin
Paul Hasler19-Jan-10 3:15
Paul Hasler19-Jan-10 3:15 
QuestionXML Interaction Pin
The ANZAC16-Jan-10 19:03
The ANZAC16-Jan-10 19:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.