[英]rename file with the name of installer name in NSIS installer?
I'm working with NSIS installer. 我正在使用NSIS安装程序。 I need to change file defined in install path to the same installer name. 我需要将安装路径中定义的文件更改为相同的安装程序名称。
I try to use rename function like: 我尝试使用重命名功能:
Rename "$INSTDIR\app.exe" "$INSTDIR\installname.exe"
but I need the installer name automatic. 但我需要自动安装程序名称。
From FileFunc header you can combine GetExeName
and GetFileName
macros to get the installer's name: 从FileFunc标头,您可以组合GetExeName
和GetFileName
宏来获取安装程序的名称:
!include "FileFunc.nsh"
OutFile test.exe
section main
${GetExeName} $R0
${GetFileName} "$R0" $R1
MessageBox MB_OK "My installer's exe is $R1"
sectionend
Now you can test it yourself. 现在你可以自己测试一下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.