# Customized application launchers

**URL:** https://discourse.slicer.org/t/customized-application-launchers/564
**Category:** Development
**Created:** [June 23, 2017, 7:01pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564 "2017-06-23T19:01:41Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [June 23, 2017, 7:01pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/1 "2017-06-23T19:01:41Z")

</div>

What @che85 and I considered in the past (and I think we discussed this with @lassoan) is to include “launchers” (for the lack of a better word) that would provide access to the application/community-specific slicelet.

The user would still install the full Slicer application downloaded from the same central location, but (perhaps as an option at install time) they would get a separate icon for a focused functionality that would launch specific slicelet, which would not expose the full application with all the bells and whistles.

I am still a bit lost about what is SlicerVerse, and what defines “a SlicerDistribution” or “something that is customized enough to meet the needs of a certain biomedical community” - I think the guidelines are fuzzy or non-existing. But what I suggest would provide access to the very focused application UI developed for a specific need, distributed as part of Slicer. I think if the main goal is to hide the complexities of Slicer that are irrelevant to a given task, it might be enough to achieve that goal.

---

<div class="post-metadata">

### Author: ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)
#### Post date: [June 23, 2017, 8:39pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/2 "2017-06-23T20:39:21Z")

</div>

2 posts were merged into an existing topic: [Communities / “SlicerVerse”](https://discourse.slicer.org/t/communities-slicerverse/40)

---

<div class="post-metadata">

### Author: ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)
#### Post date: [June 23, 2017, 7:24pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/4 "2017-06-23T19:24:55Z")

</div>

I absolutely agree. There are often situations where users are overwhelmed by the Slicer user interface and developers decide to create their own slicelets.

I think it would be a great feature to have shortcuts within one’s Application directory (regarding MacOS) that allow starting an extension slicelet for hiding the complexity of Slicer.

Another 👍 for extensions that provide a slicelet would be to have a checkbox within the ExtensionManager which says “Add slicelet shortcut to my applications” or something similar.

The structure for the ExtensionIndex might need to be extended then I guess.

---

<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: [June 23, 2017, 8:57pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/5 "2017-06-23T20:57:53Z")

</div>

Good point, this is a nice approach, too. Based on this, I update the list of existing customization options:

1. User downloads standard Slicer installer and installs extensions manually.
2. Custom installers (have custom application name, some additional extensions are bundled, some modules are excluded) - this can be built without modifying anything in Slicer source code, just by tuning CMake options (except resources). No extension manager access.
3. CustomSlicerGenerator: It works but it has two serious limitations (no installer is available, just a zip file; resources, such as any icons and bitmaps shown in the application are not customizable - except application icon and splash screen).
4. Custom launcher: Shortcut in the Start menu (Windows) or Application directory (MaxOSX) that starts Slicer, jumping right into a slicelet (module with a simplified user interface). It uses standard Slicer installation.

All these options have some merits. I guess we just need to decide if we want to promote one of these methods to be an officially supported, widely advertised solution for distributing customized Slicer versions.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [June 24, 2017, 4:59pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/6 "2017-06-24T16:59:59Z")

</div>

> [@lassoan](#):
>
> CustomSlicerGenerator: It works but it has two serious limitations (no installer is available, just a zip file; resources, such as any icons and bitmaps shown in the application are not customizable - except application icon and splash screen).

First let me comment on these issues:

- it would be trivial to add a windows installer to the CustomSlicerGenerator. The current cpack method used for Slicer is NSIS and has been unchanged for well over a decade and it basically just starts from a redistributable directory of the app. (Of course, as @bpaniagua has confirmed a zip file containing an executable is completely usable even by clinical users)

- I believe all the Slicer resources can be overridden from python; if not that is probably a limitation to be fixed in any case. However I also suspect that any slicelet or other customized app is going to create a whole new interface that remixes the slicer widgets so the application side of that would have its own resources anyway. (@lassoan can you give a specific example you’d like to change but cannot currently?)

I also think we need to weigh these issues against the benefits of the CustomSlicerGenerator:

- Custom app maintainers don’t need to have cmake or compilers or even have access to all the build platforms

- customized versions can be built using the standard slicer packages and extensions from using any platform (e.g. linux script can generate linux, mac, and windows custom versions)

- re-uses the existing factory and extension resources rather than duplicating them

- leverages the python customization features of the Slicer core, so any improvements there will have side benefits for other extensions

- As @bpaniagua says, specific versions multiple extensions can be pulled together in a bundle version which simplifies support

---

<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: [June 24, 2017, 6:21pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/7 "2017-06-24T18:21:10Z")

</div>

> [@pieper](#):
>
> confirmed a zip file containing an executable is completely usable even by clinical users

I can very easily find any number of users who has no clue what to do with a zip file but can easily install using an installation package. You would not have start menu shortcuts, uninstaller, etc. either. So, I would not even consider this as a viable option.

It’s certainly possible to create/edit an NSIS project file (project.nsi) manually but it requires some work. For example, you need to list explicitly list in the .nsi file all files that need to be uninstalled. If you add some files to the distribution you need to edit the .nsi file and add an uninstall command for each.

> [@pieper](#):
>
> I believe all the Slicer resources can be overridden from python

I don’t think it is possible to override resources that are built into the application. It is possible to dynamically load/unload complete resource files, but then you need to compile a resource file using Qt’s resource compiler for creating a custom package.  
If we know in advance what images we allow to replace (for example the large Slicer logo at the top of the module panel) then we can change the implementation to load those from individual external files instead of a resource package.

There a number of other things that can be nicely configured at build time but not dynamically - see the long list of options [here](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Customizing_application_build). These were all specifically added because customers needed to change it.

I agree that having a way of customizing a Slicer package without setting up a compiler would be really, really good. All benefits that you listed are valid and I could add a few more. The only issue is that it would be so much work to implement (and maintain) all the necessary hooks and additional mechanisms that would make this solution feasible. in contrast, we have an almost complete solution by simply building Slicer core, customized through CMake options.

If we decide to go that way, I would be ready to help with improving the custom slicer generator, but it would require a lot of efforts from others, too.

---

<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: [June 24, 2017, 8:19pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/8 "2017-06-24T20:19:47Z")

</div>

> [@pieper](#):
>
> can you give a specific example you’d like to change but cannot currently?

Currently we customize these in our custom application packages:

- All application options defined [here](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Customizing_application_build).
- These resource files:
  - Applications\SlicerApp\Resources\Icons\Large(appname)-DesktopIcon.png
  - Applications\SlicerApp\Resources\Icons\Medium(appname)-DesktopIcon.png
  - Applications\SlicerApp\Resources\Icons\Small(appname)-DesktopIcon.png
  - Applications\SlicerApp\Resources\Icons\XLarge(appname)-DesktopIcon.png
  - Applications\SlicerApp\Resources\Icons\XXLarge(appname)-DesktopIcon.png
  - Applications\SlicerApp\Resources\Images(appname)-Logo.png
  - Applications\SlicerApp\Resources\Images(appname)-ModulePanelLogo.png
  - Applications\SlicerApp\Resources\Images(appname)-SplashScreen.png
  - Applications\SlicerApp\Resources(appname).icns
  - Applications\SlicerApp\Resources(appname).ico

If these remain customizable and an installer can be generated on all platforms, then using custom slicer generator will be an acceptable option for us.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [June 25, 2017, 12:27pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/9 "2017-06-25T12:27:26Z")

</div>

> [@lassoan](#):
>
> I can very easily find any number of users who has no clue what to do with a zip file but can easily install using an installation package. You would not have start menu shortcuts, uninstaller, etc. either. So, I would not even consider this as a viable option.

Yes, for windows users an installer can be helpful so we should add an option to create one. I haven’t looked in a _very_ long time but it should be easy to just recursively list all the files in the custom slicer directory and tell NSIS to install them.

Of course there’s also the issue that some PCs will let you run executables from zip files, but won’t let you install without admin accounts so people may still want the zip option in some cases.

> [@lassoan](#):
>
> All application options defined here.

Other than Slicer\_USE\_PYTHONQT\_WITH\_OPENSSL (which I doubt you want to change) it looks like those all just turn modules on or off or set things in the Settings file. These are easy to customize already.

The rest of the options you list should be editable with [ctkResEdit](https://github.com/jcfr/ResEdit/blob/master/README.md) or an existing platform specific variant.

Of course, people _will always_ have the option of working from the CMake level to create their own amazing project, but as we all know that is _not easy at all!_

---

<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: [June 25, 2017, 4:55pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/10 "2017-06-25T16:55:44Z")

</div>

> [@pieper](#):
>
> there’s also the issue that some PCs will let you run executables from zip files, but won’t let you install without admin accounts

That’s just a simple setting if the installer should ask for elevated access. It is usually set for elevated access so that you can install in Program Files folder. If the installer does not request for elevated access then any user can run it and then typically you set the install folder to be in the user’s profile (this is for example how [Plus applications installer](http://www.plustoolkit.org) is configured).

> [@pieper](#):
>
> it should be easy to just recursively list all the files

Not very simple, but it can be certainly implemented in Python (some directory walking and text file generation based on a template). This is already implemented in CMake but if we don’t want to depend on CMake then it has to be reimplemented from scratch.

> [@pieper](#):
>
> set things in the Settings file

Default settings are now hardcoded in the application. If a key is missing then the application creates it and initializes it with the default value. Of course the setting can be changed in Python but you don’t know if a particular setting is a default value set by the application (can be updated) or set by the user (must not be changed). If we don’t implement some sophisticated mechanism then some user settings will be lost on application install.

> [@pieper](#):
>
> just turn modules on or off

There is also disclaimer text. There are many solutions for this, just have to implement one of them.

Overall, no blocking issues, just many small things and a few larger mechanisms would need to be implemented.

---

<div class="post-metadata">

### Author: ![Tesla2678](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tesla2678/32/9062_2.png) [@Tesla2678](https://discourse.slicer.org/u/Tesla2678)
#### Post date: [December 1, 2021, 6:50am UTC](https://discourse.slicer.org/t/customized-application-launchers/564/11 "2021-12-01T06:50:54Z")

</div>

> [@lassoan](#):
>
> tuning CMake options (except resources)

Hello lassoan,

Would you tell me how to implement “tuning CMake options (except resources)”.

Thank you!

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [December 1, 2021, 7:20am UTC](https://discourse.slicer.org/t/customized-application-launchers/564/12 "2021-12-01T07:20:27Z")

</div>

> Would you tell me how to implement “tuning CMake options (except resources)”.

`just by tuning CMake options` originally referenced by @lassoan means you can simply toggle CMake options during the configuration step described in [Build Instructions — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/index.html)

To provide the full context, I quoted below the original answer where this was mentioned.

> [@lassoan](#):
>
> - User downloads standard Slicer installer and installs extensions manually.
> - Custom installers (have custom application name, some additional extensions are bundled, some modules are excluded) - this can be built without modifying anything in Slicer source code, just by tuning CMake options (except resources). No extension manager access.
> - CustomSlicerGenerator: It works but it has two serious limitations (no installer is available, just a zip file; resources, such as any icons and bitmaps shown in the application are not customizable - except application icon and splash screen).
> - Custom launcher: Shortcut in the Start menu (Windows) or Application directory (MaxOSX) that starts Slicer, jumping right into a slicelet (module with a simplified user interface). It uses standard Slicer installation.

---

<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: [December 1, 2021, 2:53pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/13 "2021-12-01T14:53:04Z")

</div>

There are different options now, most importantly the [Slicer custom application template](https://github.com/KitwareMedical/SlicerCAT).

---

<div class="post-metadata">

### Author: ![Tesla2678](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tesla2678/32/9062_2.png) [@Tesla2678](https://discourse.slicer.org/u/Tesla2678)
#### Post date: [December 3, 2021, 10:52am UTC](https://discourse.slicer.org/t/customized-application-launchers/564/14 "2021-12-03T10:52:11Z")

</div>

Hello jcfr,  
Thank you for your reply,  
I still can’t find the configuration when creating the installer package.  
I have built already, I added a new module, and then want to create a new installer package containing the new modules.

> ## Package Slicer (create installer package)[¶](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/windows.html#package-slicer-create-installer-package)
> 
> - Start Visual Studio with the launcher:
> 
> Slicer.exe --VisualStudioProject
> 
> - Select `Release` build configuration.
> - In the “Solution Explorer”, right click on `PACKAGE` project (in the CMakePredefinedTargets folder) and then select `Build` .

---

<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: [December 14, 2021, 2:31pm UTC](https://discourse.slicer.org/t/customized-application-launchers/564/15 "2021-12-14T14:31:07Z")

</div>

The settings are here:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/d/1de2a2a58d9cca56dca196e1bbc950f1fa2dd48b.png)
