Skip to main content
Known Participant
March 16, 2021
Question

RH: 2020 Call from application using window.location.replace() from redirect topic stopped working

  • March 16, 2021
  • 12 replies
  • 338 views

We have a quite large structure of merged CHMs for our applications where we locate the corresponding chm using a call from the application with this call:

 

System.Windows.Forms.Help.ShowHelp(
this, path, HelpNavigator.Topic,
"redirect.htm#help_file.chm::/" + page);
 
The redirect.htm topic contains the following script code:
window.location.replace(window.location.hash.substring(1));
 
This has been working fine from 2013 and until now, when I upgraded the master project to RH 2020.
 
Is there anything that could have made this mechanism to break with this upgrade?
 
BR,
Rannveig
    This topic has been closed for replies.

    12 replies

    Known Participant
    March 17, 2021

    Thx for the response Amebr.

    The redirect.htm is a part of the master chm file, as before (when it worked). We also tried to add a copy of it standalone in the same folder as the CHMs, but that did not do any difference.

     

    As RH 2019 was uninstalled when I upgraded to RH 2020, I don't have that version installed now. 

    What I noticed was that the contents of the <script> section with the JavaScript was removed when I upgraded the project to RH 2020. I added the JavaScript code from an old copy of the redirect.htm topic. Is there any change regarding this area from RH Classic to RH 2020?

     

    Before the upgrade, the master project was in the same folder as the generated CHMs from the sub-projects. As of RH 2020 this is no longer possible, and the master project is now in a separate folder, in the same way as the projects for the other CHMs, and the output is generated to the same folder. As the generated CHM files still are in the same location, it is not obvious that this should be a problem.

     

    Any ideas would be really welcome, as I feel really stuck with this problem. The developer has also done some testing from the code side, but we haven't found out anything else than that the redirect mechanism is not working. When we add back the master CHM from before the upgrade, everything works, so the change must have come with the new version.

    Community Expert
    March 17, 2021

    The redirect.htm file lives outside the chm, right? So it's part of your application, which then opens the chm? It's been a long times since I used chms, so I'm rusty on how we used to work with them.

     

    One thing with the upgrade is the underlying structure of the project, and potentially the output, changed. It's possible the "page" path is no longer the same as it was when generated from Classic. If you still have Classic installed on your computer, you could use Tools > Toolbox > HTML Help Studio to open the chm and check the internal structure to see if it's different from the old one.