I have code
static string appPathdata = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
static string conStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + appPathdata + ";";
and this is for pdf ope System.Diagnostics.Process.Start(@"D:\Invoices\"+ ID + ".pdf");
I have this connection string and i have added my database .mdb in debug folder when i create folder and install it in other pc but its its taking my pc path and i am creating pdf file in my project afert creating pdf it should open automatically but its not opening pls help me out from these two problems.
I suspect the issue is that the code in the app needs (after it's been installed) to know exactly where the files were installed, like that pdf file that is hardcoded with a D: path. Obviously your own code knows where it's running from, but you have to tell other programs. The general answer is that the folders in the setup that have fixed locations (like CommonFilesFolder) have corresponding mappings in Environment.SpecialFolder. The application path is variable because the user chooses it at install time. The way to find that path is to create a registry item in the registry view of the setup projects IDE with the exact value [TARGETDIR] and that will resolve to the actual path at install time. Read that out with your code and use it.