I have created a .msi installer file for my PowerPoint add-in developed using C# VSTO. I have to open a help file pdf on ribbon button click. I have embedded the help file pdf with the msi package.
I have implemented this feature by using a hard-coded path(the default path where the add-in will get installed) using below code:
private void btnHelp_Click(object sender, RibbonControlEventArgs e)
{
string filepath = @"C:\Program Files (x86)\Microsoft\Office\PowerPoint\AddIns\myAddin\HelpFile.pdf";
string locationToSavePdf = Path.Combine(Path.GetTempPath(), filepath);
Process.Start(locationToSavePdf);
}
But I know that this won't work as soon as the end-user changes the location where she/he wants to install the add-in. Can any one help me with this so that I can get the path of the help file pdf dynamically(As soon as the user changes the location) or is there any other approach?
Any help/suggestion is appreciated. Thanks.