jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

.NET CA Deleting Folder Failing on Server but Not on Desktop

I have a very simple C# custom action that deletes a folder at the very end of the installation on the "Finish" button click. The folder is deleted when I run the installer on a desktop, but not when it is run on a server. I am logged in as the Administrator. A VBScript that renames a file on the same event works on the desktop but not on the server. The server I am working with is a Windows Server 2008 R2.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: .NET CA Deleting Folder Failing on Server but Not on Des

Hello,

I'm not sure why this happens. Can you please set your custom actions to run as deferred with no impersonation and see if the behavior still persist? Also, can you try to manually run the related custom actions on target machine and see if they work as expected?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: .NET CA Deleting Folder Failing on Server but Not on Des

Those options are grayed out
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: .NET CA Deleting Folder Failing on Server but Not on Des

Hello,

I apologize because I was not aware that your custom action is added without sequence. Can you please add your custom action as a custom action with sequence, scheduled before "Install Execution Stage -> Finish Execution -> InstallFinalize" standard action, and see if the behavior persist? Also, as another approach you can enable the "Run as administrator" option from "Install Parameters" page and see if this works.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: .NET CA Deleting Folder Failing on Server but Not on Des

I don't have Finish Execution. Attached are my options.
Attachments
Custom Actions
Custom Actions
Finish Execution.PNG (7.51 KiB) Viewed 5195 times
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: .NET CA Deleting Folder Failing on Server but Not on Des

That is because you have an older version of Advanced Installer, no problem. Just drag and drop the custom action before InstallFinalize, and set it
as "Deferred with no impersonation", so it executed with full admin permissions.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”