# Slicer-5.2.2 not starting on Windows Server 2016 using Microsoft Application Virtualization (appv)

**URL:** <https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944>\
**Category:** Support\
**Created:** [June 9, 2023, 3:42pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944 "2023-06-09T15:42:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernhard](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Bernhard](https://discourse.slicer.org/u/Bernhard)\
**Post date:** [June 9, 2023, 3:42pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/1 "2023-06-09T15:42:30Z")

</div>

Operating system: win10, windows server 2016  
Slicer version: 5.2.2  
Expected behavior: starting  
Actual behavior: not starting

Hi all  
we are distributing software through Microsoft Application Virtualization (appv). Previous versions (latest was 4.10) were no problem, but version 5.2.2 does not start.

There are no error messages, no error dialogs, and no errors in the log files. The splash dialog appears, closes, appears again, and then the program just closes.

Interestingly, that happens also on a machine where 3dslicer 5.2.2 is installed locally, but started from within a so called virtual bubble.

Any idea what to look for?

the last line of the log file is:  
[DEBUG][Python] 09.06.2023 13:24:02 [Python] (C:\ProgramData\NA-MIC\Slicer 5.2.2\lib\Slicer-5.2\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentStatistics

thanks in advance for any suggestion!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 9, 2023, 4:49pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/2 "2023-06-09T16:49:33Z")

</div>

> [@Bernhard](#):
>
> the last line of the log file is:

Please provide the full log.

---

<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 9, 2023, 7:45pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/3 "2023-06-09T19:45:22Z")

</div>

I don’t know anything about appv so I searched for it and the first hit had this message, so maybe you can try the suggested replacement?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/e/4e934ca83effafb6a389050b19f02dacb6dbdac8.png)

Generally speaking there have been troubles with graphics drivers on remote desktops on windows so hopefully the newer versions won’t have these problems.

---

<div class="post-metadata">

**Author:** ![Bernhard](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Bernhard](https://discourse.slicer.org/u/Bernhard)\
**Post date:** [June 12, 2023, 7:54am UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/4 "2023-06-12T07:54:09Z")

</div>

[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Session start time …: 2023-06-12 09:48:50  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Slicer version …: 5.2.2 (revision 31382 / fb46bd1) win-amd64 - installed release  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Operating system …: Windows / Professional / (Build 19044, Code Page 65001) - 64-bit  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Memory …: 4095 MB physical, 5443 MB virtual  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - CPU …: GenuineIntel , 4 cores, 4 logical processors  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - VTK configuration …: OpenGL2 rendering, TBB threading  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Qt configuration …: version 5.15.2, with SSL, requested OpenGL 3.2 (compatibility profile)  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Internationalization …: disabled, language=  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Developer mode …: disabled  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Application path …: C:/Users/test/Desktop/Slicer/bin  
[DEBUG][Qt] 12.06.2023 09:48:50 (unknown:0) - Additional module paths …: (none)  
[DEBUG][Python] 12.06.2023 09:48:59 [Python] (C:\Users\test\Desktop\Slicer\lib\Slicer-5.2\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: Annotations  
[DEBUG][Python] 12.06.2023 09:49:01 [Python] (C:\Users\test\Desktop\Slicer\lib\Slicer-5.2\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentEditor  
[DEBUG][Python] 12.06.2023 09:49:01 [Python] (C:\Users\test\Desktop\Slicer\lib\Slicer-5.2\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentStatistics

---

<div class="post-metadata">

**Author:** ![Bernhard](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Bernhard](https://discourse.slicer.org/u/Bernhard)\
**Post date:** [June 16, 2023, 10:16am UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/5 "2023-06-16T10:16:04Z")

</div>

we could create a workaround.  
the reason Slicer.exe did not start correctly are all the environment variables that are set by the slicer.exe, but they are not valid inside an virtual appv package.  
The workaround is to set the variables correctly first, and then start the slicerapp-real.exe

---

<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 16, 2023, 1:51pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/6 "2023-06-16T13:51:04Z")

</div>

[Many people struggle with this odd behavior of App-V](https://social.technet.microsoft.com/Forums/en-US/3da89298-f44c-405a-94b9-c4b577585361/appv-5-package-ignores-environment-variable-included-in-virtual-registry) on this old Windows Server version and there does not seem to be a clear solution, only workarounds like you described. Probably the issue is fixed in more recent Windows Server versions.

---

<div class="post-metadata">

**Author:** ![Bernhard](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Bernhard](https://discourse.slicer.org/u/Bernhard)\
**Post date:** [June 17, 2023, 11:09am UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/7 "2023-06-17T11:09:56Z")

</div>

Dear Andras,  
thanks for your reply. However: this behavious also occurs on windows 11 machines. It is clearly not a question of OS version. Rather, the paths inside the virtual bubble of an appv package are completely different than on a “real” installation.

cheers

---

<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 17, 2023, 12:41pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/8 "2023-06-17T12:41:39Z")

</div>

Thanks for the clarification. Did I understand correctly that you tried to start the application by running Slicer.exe and it failed because the environment variables that Slicer.exe set were not passed on to SlicerApp-real.exe (SlicerApp-real.exe did not inherit its environment from the process or launched it but got some default environment)?

---

<div class="post-metadata">

**Author:** ![Bernhard](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Bernhard](https://discourse.slicer.org/u/Bernhard)\
**Post date:** [June 17, 2023, 12:57pm UTC](https://discourse.slicer.org/t/slicer-5-2-2-not-starting-on-windows-server-2016-using-microsoft-application-virtualization-appv/29944/9 "2023-06-17T12:57:03Z")

</div>

Dear Andras,  
let’s say I did a “real” install on a win10 machine, installing as admin to c:\programdata\slicer5. If I start a cmd.exe after install, no new variables are set. But variables were created. you can see them by:  
start slicer  
click add data button  
click “choose file…”  
in the file name field, enter c:\windows\system32\cmd.\*  
click Open button. Scroll down, rightclick cmd.exe and select Open in the context menu.  
in the cmd window, enter set to see these variables set:  
Path=C:/ProgramData/NA-MIC/Slicer5/bin/…/bin;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2/cli-modules;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2/qt-loadable-modules;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2;C:/ProgramData/NA-MIC/Slicer5/bin/…/…/lib/Slicer-5.2/qt-loadable-modules;C:/ProgramData/NA-MIC/Slicer5/bin/…/…/lib/Slicer-5.2/qt-loadable-modules/Release;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Python/Lib/site-packages/numpy/core;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Python/Lib/site-packages/numpy/lib;C:/ProgramData/NA-MIC/Slicer5/…/lib/Slicer-5.2/qt-loadable-modules;C:/ProgramData/NA-MIC/Slicer5/…/lib/Slicer-5.2/qt-loadable-modules/Release;  
PYTHONHOME=C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Python  
PYTHONNOUSERSITE=1  
PYTHONPATH=C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2/qt-scripted-modules;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2/qt-loadable-modules;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/vtkTeem;C:/ProgramData/NA-MIC/Slicer5/bin/…/bin/Python;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Slicer-5.2/qt-loadable-modules/Python;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Python/Lib;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Python/Lib/lib-dynload;C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/Python/Lib/site-packages;C:/ProgramData/NA-MIC/Slicer5/bin/…/bin/Lib/site-packages  
QT\_PLUGIN\_PATH=C:/ProgramData/NA-MIC/Slicer5/bin/…/lib/QtPlugins

I do not know how slicer.exe evaluates all these paths. the fact of having things like bin/…/lib is also quite interesting, but no problem…

Inside an appv package, all these paths will not exist, i.e. the paths are different

cheers  
bernhard
