Mercurial > vim
comparison nsis/gvim.nsi @ 31968:aa38648a8c4e v9.0.1316
patch 9.0.1316: MS-Windows: vimfiles dir created with admin group
Commit: https://github.com/vim/vim/commit/eea0a00811e8e8e3c2d07964ea61795cce5a4665
Author: Christopher Plewright <chris@createng.com>
Date: Fri Feb 17 20:04:51 2023 +0000
patch 9.0.1316: MS-Windows: vimfiles dir created with admin group
Problem: MS-Windows: vimfiles dir created with admin group.
Solution: Use ShellExecAsUser to create the vimfiles directory. (Christopher
Plewright, Ken Takata, closes #12000, closes #11888)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 17 Feb 2023 21:15:03 +0100 |
parents | 645722244c3f |
children | 56a4023b605d |
comparison
equal
deleted
inserted
replaced
31967:0544a41d43c3 | 31968:aa38648a8c4e |
---|---|
226 !macroend | 226 !macroend |
227 | 227 |
228 !insertmacro GetParent "" | 228 !insertmacro GetParent "" |
229 !insertmacro GetParent "un." | 229 !insertmacro GetParent "un." |
230 | 230 |
231 # Get home directory | |
232 !macro GetHomeDir un | |
233 Function ${un}GetHomeDir | |
234 Push $0 | |
235 Push $1 | |
236 ReadEnvStr $0 "HOME" | |
237 ${If} $0 == "" | |
238 ReadEnvStr $0 "HOMEDRIVE" | |
239 ReadEnvStr $1 "HOMEPATH" | |
240 StrCpy $0 "$0$1" | |
241 ${If} $0 == "" | |
242 ReadEnvStr $0 "USERPROFILE" | |
243 ${EndIf} | |
244 ${EndIf} | |
245 Pop $1 | |
246 Exch $0 # put $0 on top of stack, restore $0 to original value | |
247 FunctionEnd | |
248 !macroend | |
249 | |
250 !insertmacro GetHomeDir "" | |
251 !insertmacro GetHomeDir "un." | |
252 | |
231 # Check if Vim is already installed. | 253 # Check if Vim is already installed. |
232 # return: Installed directory. If not found, it will be empty. | 254 # return: Installed directory. If not found, it will be empty. |
233 Function CheckOldVim | 255 Function CheckOldVim |
234 Push $0 | 256 Push $0 |
235 Push $R0 | 257 Push $R0 |
518 ########################################################## | 540 ########################################################## |
519 SectionGroup $(str_group_plugin) id_group_plugin | 541 SectionGroup $(str_group_plugin) id_group_plugin |
520 Section "$(str_section_plugin_home)" id_section_pluginhome | 542 Section "$(str_section_plugin_home)" id_section_pluginhome |
521 SectionIn 1 3 | 543 SectionIn 1 3 |
522 | 544 |
523 StrCpy $1 "$1 -create-directories home" | 545 # use ShellExecAsUser below instead |
546 # StrCpy $1 "$1 -create-directories home" | |
524 SectionEnd | 547 SectionEnd |
525 | 548 |
526 Section "$(str_section_plugin_vim)" id_section_pluginvim | 549 Section "$(str_section_plugin_vim)" id_section_pluginvim |
527 SectionIn 3 | 550 SectionIn 3 |
528 | 551 |
592 Section -call_install_exe | 615 Section -call_install_exe |
593 SetOutPath $0 | 616 SetOutPath $0 |
594 DetailPrint "$(str_msg_registering)" | 617 DetailPrint "$(str_msg_registering)" |
595 nsExec::Exec "$0\install.exe $1" | 618 nsExec::Exec "$0\install.exe $1" |
596 Pop $3 | 619 Pop $3 |
620 | |
621 ${If} ${SectionIsSelected} ${id_section_pluginhome} | |
622 ReadEnvStr $3 "COMSPEC" | |
623 Call GetHomeDir | |
624 Pop $4 | |
625 ShellExecAsUser::ShellExecAsUser "" "$3" '/c "cd /d "$4" & mkdir vimfiles & cd vimfiles & mkdir colors compiler doc ftdetect ftplugin indent keymap plugin syntax"' SW_HIDE | |
626 ${EndIf} | |
597 SectionEnd | 627 SectionEnd |
598 | 628 |
599 ########################################################## | 629 ########################################################## |
600 !macro SaveSectionSelection section_id reg_value | 630 !macro SaveSectionSelection section_id reg_value |
601 ${If} ${SectionIsSelected} ${section_id} | 631 ${If} ${SectionIsSelected} ${section_id} |
1040 !macroend | 1070 !macroend |
1041 | 1071 |
1042 SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin | 1072 SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin |
1043 Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home | 1073 Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home |
1044 # get the home dir | 1074 # get the home dir |
1045 ReadEnvStr $0 "HOME" | 1075 Call un.GetHomeDir |
1046 ${If} $0 == "" | 1076 Pop $0 |
1047 ReadEnvStr $0 "HOMEDRIVE" | |
1048 ReadEnvStr $1 "HOMEPATH" | |
1049 StrCpy $0 "$0$1" | |
1050 ${If} $0 == "" | |
1051 ReadEnvStr $0 "USERPROFILE" | |
1052 ${EndIf} | |
1053 ${EndIf} | |
1054 | 1077 |
1055 ${If} $0 != "" | 1078 ${If} $0 != "" |
1056 !insertmacro RemoveVimfiles $0 | 1079 !insertmacro RemoveVimfiles $0 |
1057 ${EndIf} | 1080 ${EndIf} |
1058 SectionEnd | 1081 SectionEnd |