ken-tan
Posts: 4
Joined: Mon Mar 11, 2013 5:45 am

A tree view is not redrawn by custom action.

Hi,

I use AdvancedInstaller 9.6.1 and am creating the installer.
The tree view of the folder browser dialog displayed from custom action is not redrawn.
Custom action was created as EXE of .NET Framework.
A phenomenon occurs only in Windows Server 2003 R2.

Is there any method which is made to be redrawn?

The specification of custom action (exe) is as follows.
- Display a window.
- In a window, it is a reference button.
- Display a folder browser dialog by reference button depression.

A setup by AdvancedInstaller was performed as follows.
1) Choose "Simple" of "Generic Tempretes" and create a project.
2) Add the item "Custom Actions".
3) Register custom action into "Application Folder" by "Files and Folders".
4) Register "Launch installed file" by "Custom Actions", and register custom action by "Add Custom Action with Sequence".
5) Choose "Commit with no impersonation" by "Execution Options" of custom action.

It checked by the following operations.
1) Arrange the created installer to the desktop of Windows Server 2003 R2.
2) Start in a double click.
3) Advance till the place which custom action starts.
4) Depress a reference button.
5) Depress a new folder button.
-- It is not reflected in a tree view although a new folder is created at this time.
6) Choose another folder and delete with the Delete key.
-- It is not reflected in a tree view although a folder is deleted at this time.
7) Close a dialog and depress a reference button again.
-- The folder created and deleted is reflected and displayed.

Regards,
-Ken
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: A tree view is not redrawn by custom action.

Hello Ken and welcome to Advanced Installer forums,

I'm not sure why you are encountering this behavior. Can you manually run the above custom action on the related target machine? If the behavior is the same, then I'm afraid you should debug your custom action in order to determine the root cause of this behavior.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ken-tan
Posts: 4
Joined: Mon Mar 11, 2013 5:45 am

Re: A tree view is not redrawn by custom action.

Hello Daniel.

Thank you for your reply.
I can run the above custom action on a manually related target machine.
And I can also run custom action of MSI created by VisualStudio.
However, I do this behavior by custom action of MSI created by AdvancedInstaller.
So, the thing peculiar to AdvancedInstaller was considered and it wrote to the forum.

Regards,
-Ken
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: A tree view is not redrawn by custom action.

Hi Ken,

Can you please import the MSI built with VS into Advanced Installer and check the custom action settings, to see if they are different? Even try to build it.

Note that some small editing might be required after you import the package, to refer a missing resource or something like that.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ken-tan
Posts: 4
Joined: Mon Mar 11, 2013 5:45 am

Re: A tree view is not redrawn by custom action.

Hello Daniel,

Although I built MSI by VisualStudio, imported to AdvancedInstaller and compared settings of "Custom Action", was the same.
Moreover, when built and run the imported project by AdvancedInstaller, the problem recurred.

My Custom action is very simple as follows.

//-------------------------------------------------------
private void button1_Click(object sender, EventArgs e)
{
FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
var targetPath = Environment.GetFolderPath(Environment.SpecialFolder.System).Substring(0, 3);
folderBrowserDialog1.SelectedPath = targetPath;
if (System.Windows.Forms.DialogResult.OK == folderBrowserDialog1.ShowDialog())
MessageBox.Show(folderBrowserDialog1.SelectedPath);
}
//-------------------------------------------------------

Can you try on this code?
Doesn't a problem occur in your Windows Server 2003 R2 ?

Regards,
Ken
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: A tree view is not redrawn by custom action.

Hello Ken,

I've tested your scenario and I was able to reproduce the behavior on a Windows Server 2003 test machine, but I'm not sure what is the root cause of this behavior. However, can you please use a "Launch file or open URL" custom action and see if the behavior still persist?

Here's attached a sample, created with version 9.6.1 of Advanced Installer, which implements a similar scenario (tested successfully on a Windows Server 2003 machine).
sample.zip
(6.05 KiB) Downloaded 504 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ken-tan
Posts: 4
Joined: Mon Mar 11, 2013 5:45 am

Re: A tree view is not redrawn by custom action.

Hello Daniel,

Thank you for the offer of a test and a sample.

I tested your scenario. And it ran correctly on the Windows Server 2003 R2 testing machine.
However, the problem reappeared only by changing "Execution Options" of custom action into "Deferred with no impersonation" from "Deferred".
Since administrator authority is required for my custom action for acting before the audience, it needs a "no impersonation" setting.

Is there any way a problem is avoidable with "no impersonation" validated?

Regards,
Ken
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: A tree view is not redrawn by custom action.

Hello Ken,

In order to achieve this you can disable the "Run under the LocalSystem account with full privileges (no impersonation)" execution option and use a command like this:

Code: Select all

Command: /RunAsAdmin "[#Browser.exe]"
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”