NSIS adding an Application installation path to path

Source: Internet
Author: User

Registry key for the system path of path
!define Product_uninst_root_key the abbreviation of "HKLM"//hkey_local_machine

!define path_key "SYSTEM\CurrentControlSet\Control\Session manager\environment"//path corresponding to the registry key under HKLM

Field area added after installation is complete

Var VPath//new Plus, custom variable to accept the value of the variable in the original path
Section-post
Writeuninstaller "$INSTDIR \uninst.exe"
Writeregstr ${product_uninst_root_key} "${product_uninst_key}" "DisplayName" "$ (^name)"
Writeregstr ${product_uninst_root_key} "${product_uninst_key}" "UninstallString" "$INSTDIR \uninst.exe"
Writeregstr ${product_uninst_root_key} "${product_uninst_key}" "DisplayVersion" "${product_version}"
Writeregstr ${product_uninst_root_key} "${product_uninst_key}" "Urlinfoabout" "${product_web_site}"
Writeregstr ${product_uninst_root_key} "${product_uninst_key}" "Publisher" "${product_publisher}"


Readregstr $vPath ${product_uninst_root_key} "${path_key}" "PATH"//Take the original value
strcpy $vPath "$vPath + $INSTDIR"//String connection
Writeregstr ${product_uninst_root_key} "${path_key}" "PATH" "$vPath"//write new value

Sectionend

The end, thank you!

NSIS adding an Application installation path to path

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.