A new Flexera Community experience is coming on November 25th. Click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Action Rights

I have a Installshield script with two functions in it. One to append data to the HOSTS file and another to remove the same data from the HOSTS file ( for uninstall purposes ).

I then have 2 custom actions to run the functions.

As an administrative user, both functions work (so I know my syntax is correct). But as a normal user, only the append works.

How can it be a rights issue if it's able to put the values into the HOSTS file?

Is my "remove" custom action not running with elevated rights for some reason?

Thanks.
(2) Replies
I would suggest logging the installation for more information. In addition, you can throw in a couple of messagebox in your custom actions for troubleshooting.
Okay, here's some snippets from the MSI log file:

*** Admin (works):

MSI (s) (04:B8): Executing op: ActionStart(Name=AppendHOSTS,,)
Action 10:42:49: AppendHOSTS.
MSI (s) (04:B8): Executing op: CustomActionSchedule(Action=AppendHOSTS,ActionType=1025,Source=BinaryData,Target=f1,)
MSI (s) (04:B8): Creating MSIHANDLE (19) of type 790536 for thread 3768
1: Loading to Append C:\WINDOWS\System32\drivers\etc\hosts.
1: OpenFile succeeded.
1: Writing line: ###################################
1: Writing line: # CONTROL HOST FILE ADDITIONS BEGIN
1: Writing line: ###################################
1: Writing line: 00.00.00.00 server
1: Writing line: 00.00.00.00 server
1: Writing line: ###################################
1: Writing line: # CONTROL HOST FILE ADDITIONS END
1: Writing line: ###################################
1: Closing file.
MSI (s) (04:B8): Executing op: ActionStart(Name=CreateShortcuts,Description=Creating shortcuts,Template=Shortcut: )
Action 10:42:50: CreateShortcuts. Creating shortcuts

*** now here's the User (works, sortof)

MSI (s) (FC:F4): Executing op: ActionStart(Name=AppendHOSTS,,)
Action 10:46:18: AppendHOSTS.
MSI (s) (FC:F4): Executing op: CustomActionSchedule(Action=AppendHOSTS,ActionType=1025,Source=BinaryData,Target=f1,)
MSI (s) (FC:F4): Creating MSIHANDLE (7) of type 790536 for thread 3572
MSI (s) (FC:F4): Executing op: ActionStart(Name=CreateShortcuts,Description=Creating shortcuts,Template=Shortcut: )
Action 10:46:19: CreateShortcuts. Creating shortcuts

Now oddly enough, the user portion actually works during install. but for some reason it doesn't output the lines that I tell it to.