zoukankan      html  css  js  c++  java
  • Nsis安装制作提醒

    一、安装中涉及系统环境路径的问题:
    NSIS 中部分变量可以通过一个环境设置命令 SetShellVarContext 来设置:
    # 设置为当前用户
    SetShellVarContext current
    # 此时 $DESKTOP 指向 C:UsersAdministratorDesktop
    # 设置为所有用户
    SetShellVarContext all
    # 此时 $DESKTOP 指向 C:UsersPublicDesktop
    SetShellVarContext 会影响到如 $DESKTOP、$DOCUMENTS、$SMPROGRAMS、$APPDATA 等很多变量的值。上面的路径是在 Windows 7 系统下 Administrator 用户的路径,实际中这些变量的路径和与操作系统和用户名有关。

    在 Windows Vista 或者 Windows 7 下创建快捷方式的时候,可能由于权限问题,此快捷方式被创建到所有用户的路径。你可以通过查看你创建的快捷方式的属性,在 "常规" 下有一个 "位置",你可以看到 C:UsersPublicDesktop 这样的路径,即所有用户(公共用户)的桌面。所以需要在卸载的时候先指定 SetShellVarContext all 再进行卸载,在 XP 上不存在此问题。你还可以这样:
    # 设置为当前用户
    SetShellVarContext current
    # 你的删除代码
    # 设置为所有用户
    SetShellVarContext all
    # 你的删除代码

    二、设置程序以管理员权限运行

      Section -Post
         WriteRegStr HKCU "SOFTWAREMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers" "$APPDATAYizaojiaApp_1BinFileCompare.exe" "RUNASADMIN"
      SectionEnd

  • 相关阅读:
    Springboot 中AOP的使用
    ElasticSearch 聚合查询百分比
    ElasticSearch 入门
    elasticsearch 关联查询
    spring data elasticsearch多索引查询
    elasticsearch 拼音+ik分词,spring data elasticsearch 拼音分词
    es同步mysql同步-logstash
    jpa Specification复杂查询
    java Spring boot使用spring反射
    BeautifulSoup学习记录
  • 原文地址:https://www.cnblogs.com/jiqiwoniu/p/4413992.html
Copyright © 2011-2022 走看看