Windows app location / Run error

Greetings,

I recently had few projects on windows as well and it seems that there are some issues with the apps if i put them in the program files folder, they don`t run unless i open them with administrator privileges, and i have to do that all the time and to input the password.

Is there a certain way to have windows apps running on windows ? i tried to use the installer but same issues.
What would be the structure of an windows app, file locations, dll`s config files and so on.

So far i i put all in Documents folder it works ok but i cannot have the app there.

Thanks in advance .

If you simply copy the folder by the name of your app as it is created by Xojo upon build, it should work just fine in the C:\\Program Files(x86) folder. That is where Win32 apps should go.

Hello Michel,

Well it does not, i get an error “An exception of class IOException was not handled, The application mush shut down, Exception Error Number: 5”.

Once i right click on it and choose “Run as administrator” i have no more issues

I guess i`m holding the database as well in the same folder so i assume that this might be the issue but not sure.

Thanks.

It is.
Windows wont let you amend a files that is in a subdirectory of Program Files.
Put your support files in SpecialFolder.ApplicationSupport , and usually in a subfolder of that named for your company or app

Alright. Here is your problem : even if you don’t write to it, the database must be open as read/write. Since it is forbidden to write in the programs folder, you get your error.

At the first launch of your program, create a subfolder in SpecialFolder.ApplicationData by the name of your application, such as “com.NegreaSoft.Mygreatapp”.

Copy your database there, and use it there.

At subsequent launches, simply check with Exists if the database is there and go on.

I see Jeff just told you that.

Note that anything you write must be written there, such as preferences file.

Moral : NEVER, EVER place your data next to the exe. That was valid 20 years ago. We are in the 21st Century.

[quote=315651:@Michel Bujardet]Alright. Here is your problem : even if you don’t write to it, the database must be open as read/write. Since it is forbidden to write in the programs folder, you get your error.

At the first launch of your program, create a subfolder in SpecialFolder.ApplicationData by the name of your application, such as “com.NegreaSoft.Mygreatapp”.

Copy your database there, and use it there.

At subsequent launches, simply check with Exists if the database is there and go on.

I see Jeff just told you that.

Note that anything you write must be written there, such as preferences file.

Moral : NEVER, EVER place your data next to the exe. That was valid 20 years ago. We are in the 21st Century.[/quote]

Well it`s never to late to learn, thanks a lot guys.

BTW the same principle holds true for the three platforms.