# \`PythonSlicerLauncherSettings.ini\` points to wrong \`additionalSettingsFilePath\`

**URL:** <https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528>\
**Category:** Development\
**Created:** [March 15, 2022, 7:06pm UTC](https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528 "2022-03-15T19:06:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 15, 2022, 7:06pm UTC](https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528/1 "2022-03-15T19:06:43Z")

</div>

Hi,

It seems that in SlicerCAT the Python settings file `PythonSlicerLauncherSettings.ini->additionalSettingsFilePath` (located in `d/python-install/bin/`) points to the unexistent file:  
`d/slicersources-build/Slicer-build/SlicerLauncherSettings.ini`

as I understand it should point to:  
`d/Slicer-build/[SlicerCAT]LauncherSettings.ini`

As a result if I simply run `PythonSlicer` without slicer GUI then I have no initialized paths/env vars.

SlicerCAT built with Slicer `main` branch at latest git commit `5e6a904aea97578ce91d0c7ebc0d9c2af11472bb`  
Ubuntu 20.04

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 15, 2022, 10:56pm UTC](https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528/2 "2022-03-15T22:56:12Z")

</div>

Almost the same problem with the `SlicerDesignerLauncherSettings.ini`.

**Let me explain a little bit:**  
as I understand [SlicerCPack.cmake](https://github.com/Slicer/Slicer/blob/d14f18f386f83943d6717cedb5d18f1ce423cada/CMake/SlicerCPack.cmake#L88) is responsible for building the files `SlicerDesignerLauncherSettings.ini` and `PythonSlicerLauncherSettings.ini`.

From the above link you can see `ADDITIONAL_SETTINGS_FILEPATH_BUILD "${Slicer_BINARY_DIR}/${Slicer_BINARY_INNER_SUBDIR}/SlicerLauncherSettings.ini"` (for both Designer and Python)

Then I go **/d/CMakeCache.cmake** and I can see:  
`Slicer_BINARY_DIR:STATIC=/home/kerim/Documents/Colada/d/slicersources-build`

And in **/d/Slicer-Build/CMakeCache.cmake** :  
`Slicer_BINARY_DIR:STATIC=/home/kerim/Documents/Colada/d/Slicer-build`

Then in the main **CMakeLists.txt** you can find that [Slicer\_BINARY\_INNER\_SUBDIR](https://github.com/Slicer/Slicer/blob/d14f18f386f83943d6717cedb5d18f1ce423cada/CMakeLists.txt#L74) points to:  
`set(Slicer_BINARY_INNER_SUBDIR Slicer-build)`

I believe that is the root of the problem.  
When configuring Pythons settings file the var `Slicer_BINARY_DIR` is set to `slicersources-build`.  
And when configuring the Designer script it is set to `Slicer-build` dir.

The second point is that for Custom APP `SlicerLauncherSettings.ini` is renamed to `[SlicerCAT]LauncherSetting.ini`. Thus it should be renamed within `SlicerCPack.cmake` function (accept some variable with app name).  
App renaming also concerns the [LauncherInstall.ini](https://github.com/Slicer/Slicer/blob/d14f18f386f83943d6717cedb5d18f1ce423cada/CMake/SlicerCPack.cmake#L92)

Please take a look. If I’m right I could work on that

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 17, 2022, 1:24am UTC](https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528/3 "2022-03-17T01:24:24Z")

</div>

I haven’t been developing SlicerCAT-based applications recently. Maybe @Sam_Horvath or @cpinter can confirm if they can reproduce the issue (and if yes then why it does not impact their workflow). Most likely a fix is needed and it would be useful if you could work on that and submit a pull request.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 17, 2022, 9:46am UTC](https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528/4 "2022-03-17T09:46:43Z")

</div>

Hi! It seems you made good progress with investigating the root cause. I think the easiest would be if you submitted a pull request with the solution you find best and we can discuss the details there.

I haven’t encountered these issues because I don’t use PythonSlicer alone, and I launch designer from a normal Slicer build (the widget xml descriptors are the same so any reasonably recent Slicer-launched designer works the same).

Thanks!

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 19, 2022, 2:03am UTC](https://discourse.slicer.org/t/pythonslicerlaunchersettings-ini-points-to-wrong-additionalsettingsfilepath/22528/5 "2022-03-19T02:03:16Z")

</div>

[PR is created](https://github.com/Slicer/Slicer/pull/6274)
