Admin Rights When Saving Bitmap ?

Add-in Express™ Support Service
That's what is more important than anything else

Admin Rights When Saving Bitmap ?
 
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi David,

Why did you set ADX_PATH variable to 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensibility Projects\'?

To fix the issue you need to add AddinExpress.IE.Broker.dll to the setup project manually if the setup is a WiX based project. It is not added automatically due to the bug in the current version of ADX for IE.

e.g.


    <ComponentGroup Id="ProductComponents" >
      <Component Id="ProductComponent" Guid="<Guid>" DiskId="1" Directory="INSTALLFOLDER" >
...........
        <File Id="_AddinExpress_IE_Broker_dll" Name="AddinExpress.IE.Broker.dll" Source="c:Program Files (x86)Add-in ExpressAdd-in Express .NET for Internet ExplorerBin" />
...........
      </Component>
    </ComponentGroup>
Posted 30 Apr, 2014 11:49:02 Top
RIBEIRO David




Posts: 12
Joined: 2014-04-24
Hi,

Trying this morning and nothing new :(


------ Début de la génération : Projet : IETestAddon, Configuration : Debug Any CPU ------
  IETestAddon -> C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddoninDebugIETestAddon.dll
------ Début de la génération : Projet : IETestBrokerApp, Configuration : Debug Any CPU ------
  IETestBrokerApp -> C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestBrokerAppinDebugIETestBrokerApp.exe
------ Début de la génération : Projet : IETestAddonSetup(1.0.0), Configuration : Debug x86 ------
	C:Program Files (x86)WiX Toolset v3.8incandle.exe -sw1076 -dDebug -d"ADX_PATH=C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEExtensibility Projects\" -d"DevEnvDir=C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDE\" -d"SolutionDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddon\" -dSolutionExt=.sln -dSolutionFileName=IETestAddon.sln -dSolutionName=IETestAddon -d"SolutionPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddon.sln" -dConfiguration=Debug -dOutDir=binDebug -dPlatform=x86 -d"ProjectDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0\" -dProjectExt=.wixproj -d"ProjectFileName=IETestAddonSetup(1.0.0).wixproj" -d"ProjectName=IETestAddonSetup(1.0.0)" -d"ProjectPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0IETestAddonSetup(1.0.0).wixproj" -d"TargetDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0inDebug\" -dTargetExt=.msi -d"TargetFileName=IETestAddonSetup(1.0.0).msi" -d"TargetName=IETestAddonSetup(1.0.0)" -d"TargetPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0inDebugIETestAddonSetup(1.0.0).msi" -dIETestAddon.Configuration=Debug -d"IETestAddon.FullConfiguration=Debug|AnyCPU" -dIETestAddon.Platform=AnyCPU -d"IETestAddon.ProjectDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddon\" -dIETestAddon.ProjectExt=.csproj -dIETestAddon.ProjectFileName=IETestAddon.csproj -dIETestAddon.ProjectName=IETestAddon -d"IETestAddon.ProjectPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddon.csproj" -d"IETestAddon.TargetDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddoninDebug\" -dIETestAddon.TargetExt=.dll -dIETestAddon.TargetFileName=IETestAddon.dll -dIETestAddon.TargetName=IETestAddon -d"IETestAddon.TargetPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddoninDebugIETestAddon.dll" -dIETestBrokerApp.Configuration=Debug -d"IETestBrokerApp.FullConfiguration=Debug|AnyCPU" -dIETestBrokerApp.Platform=AnyCPU -d"IETestBrokerApp.ProjectDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestBrokerApp\" -dIETestBrokerApp.ProjectExt=.csproj -dIETestBrokerApp.ProjectFileName=IETestBrokerApp.csproj -dIETestBrokerApp.ProjectName=IETestBrokerApp -d"IETestBrokerApp.ProjectPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestBrokerAppIETestBrokerApp.csproj" -d"IETestBrokerApp.TargetDir=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestBrokerAppinDebug\" -dIETestBrokerApp.TargetExt=.exe -dIETestBrokerApp.TargetFileName=IETestBrokerApp.exe -dIETestBrokerApp.TargetName=IETestBrokerApp -d"IETestBrokerApp.TargetPath=C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestBrokerAppinDebugIETestBrokerApp.exe" -out obj\Debug -arch x86 -ext "C:Program Files (x86)WiX Toolset v3.8in\WixUIExtension.dll" -ext "C:Program Files (x86)WiX Toolset v3.8in\WixNetFxExtension.dll" Product.wxs
	C:Program Files (x86)WiX Toolset v3.8inLight.exe -out "C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0inDebugIETestAddonSetup(1.0.0).msi" -pdbout "C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0inDebugIETestAddonSetup(1.0.0).wixpdb" -sw1076 -cultures:null -ext "C:Program Files (x86)WiX Toolset v3.8in\WixUIExtension.dll" -ext "C:Program Files (x86)WiX Toolset v3.8in\WixNetFxExtension.dll" -contentsfile "obj\DebugIETestAddonSetup(1.0.0).wixproj.BindContentsFileListnull.txt" -outputsfile "obj\DebugIETestAddonSetup(1.0.0).wixproj.BindOutputsFileListnull.txt" -builtoutputsfile "obj\DebugIETestAddonSetup(1.0.0).wixproj.BindBuiltOutputsFileListnull.txt" -wixprojectfile "C:UsersWin7Prodocumentsisual studio 2013ProjectsIETestAddonIETestAddonIETestAddonSetup.0.0IETestAddonSetup(1.0.0).wixproj" obj\DebugProduct.wixobj
========== Génération : 3 a réussi, 0 a échoué, 0 mis à jour, 0 a été ignoré ==========


When I "Publish ADX Project" and install it in a clean install or on a install with prerequisites, the addon do not register on IE.
When I look to the file in the install directory (C:/Progr.../IEAddonCS/) I don't have the .EXE. (Nothing appear in the "Manage add-ons" menu.

But if I install the .MSI file generated by the WiX project Setup (Right Click on IEAddonSetup and generate) the addon register in IE but the Broker start & disapear, and the error messagebox appear (no broker pipe).

I've tested your solution by adding the line but nothing new :(
Here my Product.wxs :
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
	<Product 
    Id="97560d57-e57a-491e-9cde-c02cab9d5b92" 
    Name="IETestAddon" 
    Language="1036" 
    Version="1.0.0" 
    Manufacturer="HEVA" 
    UpgradeCode="97560d57-e57a-491e-9cde-c02cab9d5b93" 
    Codepage="1252">
    
  	<Package 
      InstallerVersion="200" 
      Compressed="yes" 
      InstallScope="perMachine" 
      Description="IETestAddon"
      Manufacturer="HEVA"
      Languages="1036"
      SummaryCodepage="1252" 
      InstallPrivileges="elevated"
    />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <Media Id="1" Cabinet="IETestAddon.cab" EmbedCab="yes" />

    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
    
    <Feature Id="ProductFeature" Title="IETestAddon" Level="1" ConfigurableDirectory="INSTALLFOLDER">
      <ComponentRef Id="INSTALLFOLDER" />
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>

    <UIRef Id="WixUI_InstallDir" />
    <UIRef Id="WixUI_ErrorProgressText" />

    <Binary Id="adxregistrator_exe" SourceFile="$(var.ADX_PATH)Redistributablesdxregistrator.exe" />
    
    <CustomAction Id="RegisterApp" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand='/install="[INSTALLFOLDER]$(var.IETestAddon.TargetFileName)" /privileges=admin /returnExitCode=false' Impersonate="yes" />
    <CustomAction Id="RollbackApp" BinaryKey="adxregistrator_exe" Execute="rollback" ExeCommand='/uninstall="[INSTALLFOLDER]$(var.IETestAddon.TargetFileName)" /privileges=admin' Impersonate="yes" Return="ignore" />
    <CustomAction Id="UnregisterApp" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand='/uninstall="[INSTALLFOLDER]$(var.IETestAddon.TargetFileName)" /privileges=admin' Impersonate="yes" Return="ignore" />

    <InstallExecuteSequence>
      <Custom Action="RegisterApp" After="StartServices"><![CDATA[$ProductComponent>2]]></Custom>
      <Custom Action="RollbackApp" After="RegisterApp"><![CDATA[$ProductComponent>2]]></Custom>
      <Custom Action="UnregisterApp" After="MsiUnpublishAssemblies"><![CDATA[$ProductComponent=2]]></Custom>
    </InstallExecuteSequence>

    <!-- Properties for all current versions of the .NET Framework are available here: http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm -->
    <PropertyRef Id="NETFRAMEWORK20"/>
    <Condition Message="This application requires .NET Framework 2.0. Please install the .NET Framework then run this installer again.">
      <![CDATA[Installed OR NETFRAMEWORK20]]>
    </Condition>

  </Product>

	<Fragment>
		<Directory Id="TARGETDIR" Name="SourceDir">
			<Directory Id="ProgramFilesFolder">
				<Directory Id="INSTALLFOLDER" Name="IETestAddon" >
         <Component Id="INSTALLFOLDER" Guid="923c83d7-824f-40d4-ab43-425a43b19615">
            <RemoveFolder On="both" Id="INSTALLFOLDER"/>
            <RegistryValue Root="HKLM" Key="Software[Manufacturer][ProductName]" Type="string" Value="IETestAddon" />
          </Component>
        </Directory>
			</Directory>
		</Directory>
	</Fragment>

	<Fragment>
    <ComponentGroup Id="ProductComponents" >
      <Component Id="ProductComponent" Guid="f276fb1c-979d-48b5-b921-f50780bcfe94" DiskId="1" Directory="INSTALLFOLDER" >
        <RegistryKey Root="HKLM" Key="Software[Manufacturer][ProductName]">
          <RegistryValue Type="string" Name="Installed" Value="[INSTALLFOLDER]"  />
        </RegistryKey>
        <File Id="_$(var.IETestAddon.TargetName)_dll" Name="$(var.IETestAddon.TargetFileName)" Source="$(var.IETestAddon.TargetPath)" />
        <File Id="_adxloader_dll_manifest" Name="adxloader.dll.manifest" Source="$(var.IETestAddon.ProjectDir)Loader" />
        <File Id="_adxloader_dll" Name="adxloader.dll" Source="$(var.IETestAddon.ProjectDir)Loader" KeyPath="yes" />
        <File Id="_adxloader64_dll" Name="adxloader64.dll" Source="$(var.IETestAddon.ProjectDir)Loader" />
        <File Id="_$(var.IETestBrokerApp.TargetName)_exe" Name="$(var.IETestBrokerApp.TargetFileName)" Source="$(var.IETestBrokerApp.TargetPath)" />
        <File Id="_IETestBrokerApp_exe_config" Name="IETestBrokerApp.exe.config" Source="$(var.IETestBrokerApp.TargetDir)IETestBrokerApp.exe.config" />
        <File Id="_AddinExpress_IE_dll" Name="AddinExpress.IE.dll" Source="C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEExtensibility ProjectsBin" />
				<File Id="_Interop_MSHTML_dll" Name="Interop.MSHTML.dll" Source="$(var.IETestAddon.TargetDir)" />
				<File Id="_Interop_SHDocVw_dll" Name="Interop.SHDocVw.dll" Source="$(var.IETestAddon.TargetDir)" />
        <File Id="_AddinExpress_IE_Broker_dll" Name="AddinExpress.IE.Broker.dll" Source="C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEExtensibility ProjectsBin" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>



Thanks.
RIBEIRO David
Posted 02 May, 2014 03:32:24 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi David,

I tested your plugin. It worked fine on my PC. What version of NET Framework installed on the problematic PC?
Please try to add '<supportedRuntime version="v4.0"/>' to the 'startup' section of the app.config file.

e.g.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup >
<supportedRuntime version="v4.0"/>
</startup>
<appSettings>
<add key="BROKER_GUID" value="{BB61627E-0CBE-444B-B159-C88B2AFDB3BF}"/>
</appSettings>
</configuration>
Posted 02 May, 2014 05:02:18 Top
RIBEIRO David




Posts: 12
Joined: 2014-04-24
Hi,

It's a http://modern.ie virutal machine, Win7 + IE 10.
By default the .NET Framework 4 Client Profile is installed.
RIBEIRO David
Posted 02 May, 2014 07:44:43 Top
RIBEIRO David




Posts: 12
Joined: 2014-04-24
I don't understand, not working for me :(

I have two problems :
1) Broker start & quit in clean install. (After some few secondes addon says "I don't have broker pipe");
2) Install :
- If I generate the MSI via VS, I have to use Setup.exe to have the Addon register in IE;
- If I generate the MSI via "Publish ADX Project", addon.exe do nothing (error don't find the vesion.xml, because I want local installation) and the .MSI don't register the addon in IE (perhaps don't install the adxloader.exe in the project directory, maybe problems of admin rights ?).


I'm turning round and round :(

don't understand why the sample project works on you PC and not in my fresh install.

What are the prerequisites if I have to install them manually ? :
- I think .NET Framework 4 or 4.5;
- And what else ?

thanks
RIBEIRO David
Posted 02 May, 2014 08:06:18 Top
RIBEIRO David




Posts: 12
Joined: 2014-04-24
I've tested the install on a user pc (none clean install) with some MessageBox on init & finalize event and works perfectly.

I think it's a prerequisites mistakes.

Well, what are the prerequisites if I have to install them manually ? :
- I think .NET Framework 4 or 4.5;
- And what else ?

To install them on a clean install and test if it's works.

Thanks
RIBEIRO David
Posted 02 May, 2014 08:17:58 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi David,

Broker start & quit in clean install. (After some few secondes addon says "I don't have broker pipe");

I reproduced this issue using your setup. The cause of the issue was in AddinExpress.IE.Broker.dll. This assembly didn't exist in the installation folder of the add-on. So, I added the assembly to the setup project and rebuilt it. All worked fine then. Please check if AddinExpress.IE.Broker.dll assembly exist in the target folder after installation.

If I generate the MSI via VS, I have to use Setup.exe to have the Addon register in IE;

IE add-ons require administrative privileges for setup programs. When you use setup.exe, it run .msi 'As Administrator'. By the way, what the operating system do you use for testing (clean install)?

What are the prerequisites if I have to install them manually ? :
- I think .NET Framework 4 or 4.5;

Your project uses .NET Framework 4.0 Full.
Posted 05 May, 2014 10:14:08 Top
RIBEIRO David




Posts: 12
Joined: 2014-04-24
Hi,

Well all working good now :) thanks a lot for the answers.

- Setup.exe install the prerequisites (full .NET Framework 4);
- MyAddon.exe is downloaded and download the MyAddon.msi;
- MyAddon.msi is installed in background (Quiet mode activated).

I'm starting Internet Explorer and all running well.



Now I'm working with the auto-updater.

I'm using the little piece of code in the documentation :

private void update()
        {
            if (this.IsNetworkDeployed() && this.IsUpdatable())
            {
                string updateUrl = this.CheckForUpdates();
                if (!String.IsNullOrEmpty(updateUrl))
                {
                    if (MessageBox.Show("A new version of the add-in was detected. " +
                    "Would you like to install the update?",
                    this.ModuleName, MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        string ieFullPath = Path.Combine(Environment.GetFolderPath(
                        Environment.SpecialFolder.ProgramFiles),
                        "Internet Explorer\iexplore.exe");

                        MessageBox.Show(""" + ieFullPath + "" "" + updateUrl + """);
                        
                        //mshtml.IHTMLWindow2 window = HTMLDocument.parentWindow;
                        //window.execScript("alert('" + updateUrl + "'); window.open('" + updateUrl + "', '_self', '');", "JScript");
                        this.CreateProcess(""" + ieFullPath + "" "" + updateUrl + """);
                    }
                }
            }
        }


I call this function in the ADXIEDocumentComplete2_EventHandler callback.

The command line passing to the CreateProcess function is correct but do nothing :
User added an image

I have to execute JavaScript code to download the *.EXE :

mshtml.IHTMLWindow2 window = HTMLDocument.parentWindow;
window.execScript("alert('" + updateUrl + "'); window.open('" + updateUrl + "', '_self', '');", "JScript");


I'm doing something wrong with the CreateProcess ?
Need Admin rights ?

Thanks in advance.


[EDIT]
I'ml using Modern.IE Virtuaboxes machine to test my Addon : http://modern.ie/virtualization-tools#downloads
RIBEIRO David
Posted 06 May, 2014 07:42:23 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi David,

Please try to use the 'Process.Start' method instead of 'CreateProcess'.
Posted 06 May, 2014 11:00:25 Top
RIBEIRO David




Posts: 12
Joined: 2014-04-24
Hi,

Work like a charm !

Thanks a lot.
RIBEIRO David
Posted 07 May, 2014 02:24:22 Top