0

I'm using InstallShield to create an MSI that runs a .cmd file which calls a powershell script. The powershell script changes 2 registry keys. One it is removing a DENY right on a registry key for SYSTEM and the other it's changing a key's value from 0 to 1.

The script runs fine when manually executed or when I simply run the .cmd file that's used within the .MSI.

When I run the .msi, however, the cmd file runs... the powershell script executes and the value gets changed from 0 to 1... however, the DENY is not removed. The msi is running an executable custom action which I named RunCMD it is set to run in "Deferred Execution in System Context" and set to run After PublishFeatures.

I am at a loss as to why running the .cmd in this way (should be elevated) is not executing the portion of the powershell script which alters the permission on the registry key but it does allow for the value change on the other key. The script definitely runs but it partially fails when run within the .msi.

Again, if I manually run the .cmd file myself the script runs without issue so it's not a problem with the script itself.

Elnator
  • 1
  • 1
  • What user is the script running as, and can you take a screenshot of the current permissions on the registry key and post that? As it is stated, there is not enough information to solve this for you. – Nathan Rice Mar 11 '15 at 16:39
  • I would say, you have answered yourself. Your PS script runs in “System Context” and it is supposed to “remove DENY right on a registry key for SYSTEM”. I bet, that if you add some error handling to your script, to retrieve the error, you will see “Access Denied”. – Jan Chrbolka Mar 12 '15 at 04:13

0 Answers0