From 9d4b5292236d16ac8a83c0fd26309a55ea46070b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 25 Jan 2016 15:57:42 -0800 Subject: [PATCH] remove any old admin desktop/sm shortcuts --- cmake/templates/NSIS.template.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 9c29e91e81..0505e44c43 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -432,12 +432,21 @@ Section "-Core installation" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application ;Create shortcuts + + ; in case the user has any shortcuts from prior to when we were using the user context, remove those now + SetShellVarContext all + RMDir /r "$SMPROGRAMS\$STARTMENU_FOLDER" + + ; go back to current user context before setting up the startmenu folder + SetShellVarContext current + CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" @CPACK_NSIS_CREATE_ICONS@ @CPACK_NSIS_CREATE_ICONS_EXTRA@ ; Conditional handling for Interface specific options ${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@} + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" \ "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" @@ -592,6 +601,15 @@ Var LaunchNowState Var CopyFromProductionState Function HandlePostInstallOptions + ; If the user created shortcuts from a time prior to when we using current user context, pull them now + SetShellVarContext all + + Delete "$DESKTOP\@INTERFACE_SHORTCUT_NAME@.lnk" + Delete "$DESKTOP\@CONSOLE_SHORTCUT_NAME@.lnk" + + ; return the context to the current user so the shortcuts are correct + SetShellVarContext current + ${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@} ; check if the user asked for a desktop shortcut to High Fidelity ${NSD_GetState} $DesktopClientCheckbox $DesktopClientState