Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
345 views
in Technique[技术] by (71.8m points)

Custom Script for windows installer in Install4j

I want to run a custom script at the end of installation on windows platform. Something as below

icacls C:InstallDir /remove "NT AuthorityAuthenticated Users" /t

We just want to remove non-privileged user from accessing the installation directory. Is there a way to add custom scripts in install4j to achieve the same. Any different suggestion will also be helpful.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can add a "Run executable or batch file" action to the "Installation" screen of your installer with the following properties:

"Executable" property: ${installer:sys.system32Dir}icacls.exe

"Arguments" property (one argument per line):

 ${installer:sys.installationDir}
 ${installer:sys.installationDir}
 /remove 

"Wait for termination" property: Selected

"Redirect stdout" property: To log file

"Redirect stderr" property: To log file

"Condition expression" property: Util.isWindows() NT AuthorityAuthenticated Users /t


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...