Author Topic: How-to preset help file on install  (Read 3669 times)

Offline sparkie

  • Single posting newcomer
  • *
  • Posts: 5
How-to preset help file on install
« on: August 16, 2017, 11:17:47 pm »
I am trying to create an install of Code::Blocks that is tailored to creating plugins for my application. I would like to have my help file preinstalled and set as the F1 default when the user first launches C::B (without requiring the user to configure it.)

Anybody have any suggestions on the best approach?


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How-to preset help file on install
« Reply #1 on: August 16, 2017, 11:21:57 pm »
Probably modify the code of the help pluign and ship this modified version.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sparkie

  • Single posting newcomer
  • *
  • Posts: 5
Re: How-to preset help file on install
« Reply #2 on: August 16, 2017, 11:28:46 pm »
Thanks. That sounds workable.

But I am hoping to minimize deviating from C::B base line too much.  I was hoping that I might be able to do some type of startup script or install a pre-configured default.cfg or create a plugin that runs once to modify the configuration or ???

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How-to preset help file on install
« Reply #3 on: August 16, 2017, 11:42:53 pm »
There is no reliable way to know how many users are added to an OS.
Also you don't know if a users is added after the software is installed.
I think there is no master config file that is copied at first run.
I think a default file one is generated and saved on first run using the default values stored in the code.

Probably you can modify the plugin to read from registry (on windows), env variable or some default file.
Then you could provide a patch which could be discussed and possibly integrated.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sparkie

  • Single posting newcomer
  • *
  • Posts: 5
Re: How-to preset help file on install
« Reply #4 on: August 17, 2017, 12:42:00 am »
Thanks.

I guess I have been staring at the portable version too long. Thanks for reminding me that each user will have his own APPs dir so modifying/installing the default.conf at install time would be fruitless (in the general case).  So, it makes sense to make changes at first run or if no help files are currently configured. 

If I modified the help plugin in a generic way that is usable to others (like fetch the default help file(s) configuration from an external file) then perhaps a patch would be accepted (and then I won't be deploying a custom version  :) )

Let me chew on this a bit.
Thanks for the inspiration.

Offline sparkie

  • Single posting newcomer
  • *
  • Posts: 5
Re: How-to preset help file on install
« Reply #5 on: August 17, 2017, 01:11:27 am »
It appears the help plugin already supports (most) of this.  After it loads the user defined help files from default.conf, it looks for  .../share/codeblocks/docs/index.ini and parses any entries it finds there.  On my install, it contains:  'CodeBlocks=codeblocks.chm'.  Replacing or appending my own help file makes it show up in the Help menu and in the 'locate in' submenu.

It appears the only thing missing is setting the DEFAULT key to 0 if currently set to -1.