Failed to open file after application installation in C# WPF

Asked

Viewed 56 times

0

I’m creating a C# installer using visual studio 2017 installer project in this project there is a user manual it is contained in the root of the project, when I run it either in Debug or Release version, Any CPU or x86 it works normal, however when I try to run the installer of my application and it does not load this manual file.

I use the following command to retrieve the path

string CaminhoRelatorio = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + @"\Modelo Manual Usuario.chm";

CaminhoRelatorio = CaminhoRelatorio.Replace("bin\\","");

System.Windows.Forms.HelpNavigator HelpN = System.Windows.Forms.HelpNavigator.TopicId;

System.Windows.Forms.Help.ShowHelp(null, CaminhoRelatorio, HelpN, ID);

The result of the truck returns me = C:\\Users\\pc01\\Desktop\\Sistema\\Modelo Manual Usuario.chm

because it cannot find this path when the installer is generated? what is the best method I can do to solve this problem. causing him to find his way

  • which error message appears ? after all, the path (folders+ file) exist and the system does not think ? If you are picking "Currentdirectory" it may be that the installer is started in another directory, like, extracts the files to a temporary folder (appdata) and runs a setup, then the value of the variable will be different

  • Is the file being copied? It comes into existence in this folder?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.