我试图安装一个文件到所有用户文档目录(Windows 7)使用NSIS。
在我的代码中,我设置了"SetShellVarContext all“,但是文件仍然安装在当前用户目录下。
请帮帮忙
这是我的密码
# define installer name
OutFile "installer.exe"
# set desktop as install directory
InstallDir $DOCUMENTS
# default section start
Section
# define output path
SetShellVarContext all
SetOutPath $INSTDIR
# specify file to go in output path
File test.txt
# define uninstaller name
WriteUninstaller $INSTDIR\uninstaller.exe
#-------
# default section end
SectionEnd
# create a section to define what the uninstaller does.
# the section will always be named "Uninstall"
Section "Uninstall"
# Always delete uninstaller first
Delete $INSTDIR\uninstaller.exe
# now delete installed file
Delete $INSTDIR\test.txt
SectionEnd发布于 2015-09-03 11:32:58
SetShellVarContext不影响InstallDir属性,必须手动设置$InstDir:
Function .onInit
SetShellVarContext all
StrCpy $InstDir $Documents
FunctionEndhttps://stackoverflow.com/questions/32372246
复制相似问题