zoukankan      html  css  js  c++  java
  • NSIS 设置系统变量

    定义

     ; include for some of the windows messages defines
       !include "winmessages.nsh"
       ; HKLM (all users) vs HKCU (current user) defines
       !define env_hklm 'HKLM "SYSTEMCurrentControlSetControlSession ManagerEnvironment"'
       !define env_hkcu 'HKCU "Environment"'

    设置

       WriteRegExpandStr ${env_hklm} "MongoBin" "D:Philipsmongodbin"
       ; and current user
       WriteRegExpandStr ${env_hkcu} "MongoBin" "D:Philipsmongodbin"
       ; make sure windows knows about the change
       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000  
    
    
    

    卸载时代码

      ; delete variable
       DeleteRegValue ${env_hklm} "MongoBin"
       DeleteRegValue ${env_hkcu} "MongoBin"
       ; make sure windows knows about the change
       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

    在CMD中使用方式:

    使用 %MongoBin% 即可得到 D:Philipsmongodbin的值

  • 相关阅读:
    codeforces 501 C,D,E
    bzoj 3172 单词 ac自动机|后缀数组
    HDU2459 后缀数组+RMQ
    POJ 3294 二分找超过一半字符串中存在的子串
    头文件
    python爬取文本
    python爬取图片
    NEW
    dsu on tree 练习题
    lzz分块+莫队
  • 原文地址:https://www.cnblogs.com/karl-F/p/6951881.html
Copyright © 2011-2022 走看看