title: Program connects after install to an unknown(?) sqlite database
body: <p>I have a strange problem using vb.net (vs2010) and SQLite database: I made an install package with Setup and Deployment project, everything seems to be working fine. My SQLite databse installs under CommonApplicationData folder and the software under ProgramFiles\ProductName. In the setup project I set a custom action, the user have a choice to run software after install:
  /StartApp="[CHECK]"</p>
  
  <pre><code>Private Sub MyInstaller_Committed(ByVal sender As Object, ByVal e As InstallEventArgs)
  Dim productName As String = Context.Parameters("ProductName")
  StartAfterInstall = Me.Context.Parameters.Item("StartApp")
  If StartAfterInstall = "1" Then
      Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))
      Shell(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\FB.exe")
  End If
  End Sub
  </code></pre>
  
  <p>In ApplicationEvents.vb I set at StartUp:</p>
  
  <pre><code>    AppDomain.CurrentDomain.SetData("DataDirectory", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData))
  </code></pre>
  
  <p>And here comes the strange behaviour: if the user starts application after install, the program connects to another(?) database, not to installed under <strong>CommonApplicationData</strong>. If the user inserts data, seems everything working fine. 
  After closing the application and starting new from the desktop/programfiles/users program menu connects the program to the database installed under CommonApplicationData, but he can't see the changes he made launching application after installation. So starting program from desktop/programfiles/users program menu => everything fine, but the first (automatic) start after install is a problem. I can't find out what happens, any ideas?</p>