1

I have C# Windows form application that works perfectly when I debug it in VS. It has SQLite database.

Then I've created a new Setup project, using InstallShield.

Visual Studio 2012 compiles it and I install application with no error.

But application is slow, when I change user controls or do any action, even to just construct a form, it takes a few seconds. Very very slow, not for using... And I don't even have any critical code, like loops or something...

In setup project I included: .exe.config, .exe, SQLite.dll and .s3db (SQLite database file)

Please help

Thanks

Boy
  • 1,182
  • 2
  • 11
  • 28
  • 1
    You have provided almost nothing that could help diagnose your problem. What is slow? What kind of app is it (WPF, WinForms, Console, Windows Service, other)? Does it connect to a database? Does it connect to the internet? Without a lot more detail you will not get much help. – Eric J. Sep 12 '13 at 22:38
  • @Eric J. Thanks for trying to help. I've recontructed the question. Please check it again. – Boy Sep 12 '13 at 23:09
  • Provide some code so we can suggest you – sourabh devpura Sep 12 '13 at 23:20
  • I can't rly provide you a code... it's about 2k lines of code... as I said before, There is no critical code. Code is fine because my program works normaly without setup. The application becomes slow when I deploy it using InstallShield (2012, spring limited edition - this might be a problem?). It think I might be doing something wrong in that part... is there maybe a chance that I haven't included something in the setup project, but program still works? – Boy Sep 13 '13 at 03:53

2 Answers2

1

Though this is an old thread, but it will be helpful for other people who comes this post via googld. The solution I discovered to solve this issue, in my case is I executed the application as Administrator and everything was fast.

Hope this helps

WatsMyName
  • 4,240
  • 5
  • 42
  • 73
1

I know this is several years old but it's one of the SO posts I saw before finding the correct answer. The reason you have to run the application as Administrator is probably because you're trying to read/write from a file such as a SQLite database file. You have to have elevated privileges in order to read/write from Program Files and Program Files(x86). I found the answer here:

Integrating SQLite with a Windows application

Basically, you'll need to save your files to another directory, preferably the AppData folder on your Windows machine. You can get there by using: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

This will put the files in the Roaming folder of AppData.

Hope this helps someone.

Community
  • 1
  • 1
John Murphy
  • 905
  • 1
  • 10
  • 26
  • That prevents having to run the application as Administrator indeed, but it doesn't explain why _not_ running it as Administrator merely makes it slow (assuming "slow" means "slow, but functioning"). – CodeCaster Jan 23 '17 at 18:44
  • 1
    @CodeCaster yeah agreed. I presume it's still somehow related to file access. I stumbled across this when my app crashed and I noticed that SQLite was referenced in the Event logs. But I also noticed the application would attempt to run in some cases, but it would run extremely slowly. Possibly it was swallowing errors and trying to do what it could to continue. – John Murphy Jan 23 '17 at 18:48