This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- vista
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 18, 2008
02:20 AM
Remove/Add File in Vista
Hi,
I called a custom action to remove file in "Program Files\My Product" folder. The custom action is calling installscript function "DeleteFile". In vista, this custom action is not working. The same thing happened if I want to edit a file or copy files to Program Files folder.
The custom action is working fine if we run from setup.exe and select "run as administrator". However, during uninstallation we use the command line "msiexec.exe /I {ProductCode}", and this does not run as administrator.
I called a custom action to remove file in "Program Files\My Product" folder. The custom action is calling installscript function "DeleteFile". In vista, this custom action is not working. The same thing happened if I want to edit a file or copy files to Program Files folder.
The custom action is working fine if we run from setup.exe and select "run as administrator". However, during uninstallation we use the command line "msiexec.exe /I {ProductCode}", and this does not run as administrator.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 18, 2008
08:42 AM
You'll need to run your custom action as "deferred in system context" so that it runs with elevated rights.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 18, 2008
09:12 PM
Yes, I did run the custom action with "deferred in system contex". But I have problem in getting Windows Installer Property.
In the installscript function, I need to get the property of "INSTALLDIR" and "SUPPORTDIR". But using deferred in system contex, I have difficulties to access these property.
Referring to this:
[CODE]
For example, if you want to retrieve the values of [INSTALLDIR], [SUPPORTDIR], and [SetupType], you would set the Property Value setting of your type 51 custom action to this:
[INSTALLDIR];[SUPPORTDIR];[SetupType]
where each property is separated by a semicolon.
You can use code such as the following VBScript to “unpack” the values from the CustomActionData property:
Dim PropArray
PropArray = Split(Session.Property("CustomActionData"), ";")
INSTALLDIR = PropArray(0)
SUPPORTDIR = PropArray(1)
SetupType = PropArray(2)
[/CODE]
How can I get the INSTALLDIR value from VBscript and pass to my installscript function?
In the installscript function, I need to get the property of "INSTALLDIR" and "SUPPORTDIR". But using deferred in system contex, I have difficulties to access these property.
Referring to this:
[CODE]
For example, if you want to retrieve the values of [INSTALLDIR], [SUPPORTDIR], and [SetupType], you would set the Property Value setting of your type 51 custom action to this:
[INSTALLDIR];[SUPPORTDIR];[SetupType]
where each property is separated by a semicolon.
You can use code such as the following VBScript to “unpack” the values from the CustomActionData property:
Dim PropArray
PropArray = Split(Session.Property("CustomActionData"), ";")
INSTALLDIR = PropArray(0)
SUPPORTDIR = PropArray(1)
SetupType = PropArray(2)
[/CODE]
How can I get the INSTALLDIR value from VBscript and pass to my installscript function?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 22, 2008
08:25 AM
You should probably look in the Windows Installer and InstallShield help for "CustomActionData". The elevated process in Windows Installer has very limited access to the MSI properties; using CustomActionData allows you to pass information to custom actions running elevated.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 23, 2008
03:39 AM
Hi,
If you do not want to disable the UAC service:
I suggest trying to run modify from the setup.exe instead of from add/remove programs (which runs the msi directly) in order for vista to allow elevation.
If you want to disable the UAC service:
Go to registry key:
Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System
and set EnableLUA=0 instead of 1.
then run the add/remove again - it should be able to modify the file system.
Sharon.
If you do not want to disable the UAC service:
I suggest trying to run modify from the setup.exe instead of from add/remove programs (which runs the msi directly) in order for vista to allow elevation.
If you want to disable the UAC service:
Go to registry key:
Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System
and set EnableLUA=0 instead of 1.
then run the add/remove again - it should be able to modify the file system.
Sharon.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)