0

The following code is a peace of a script that is set up to be executed by InstallShield when installing my application: Custom Actions During Installation > After Register Product

 Set wsShell = CreateObject("WScript.Shell")
 wsShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\My Program\FilePath", "{the file path}"

When I run the script from command line it runs as it should and writes to the registry. But when I try to use the setup file it shows no errors, but the registry value is not set.

Why is it not working?

I'm running it as administrator.

Nathan Rice
  • 3,091
  • 1
  • 20
  • 30
GxFlint
  • 294
  • 3
  • 15
  • Related http://stackoverflow.com/q/14384235/692942. Is it possible that due to 32 bit vs 64 bit the registry entry is ending up in the wrong area of the registry? Does the installer run in 32 bit or 64 bit, plus what is the OS, 32 or 64 bit? – user692942 Dec 03 '16 at 09:38

1 Answers1

0

You can use this code to log information in you msi log, it might help you figure out what is happening

Function LogMSIInfo(msg,msgtype)
    Dim rec
    Set rec = Session.Installer.CreateRecord(1) 
    rec.StringData(0) = msg
    LogMSIInfo = Session.Message(&H04000000, rec)
End Function
Tiny sam
  • 58
  • 6