Uninstall Add-in files...

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

Uninstall Add-in files...
 
skuske




Posts: 53
Joined: 2009-12-30
Thanks, Andrei,

does that mean that I should not add any stuff to AddinStartupComplete ? The things that are happening when I unregister through regsvr32 are all things that are part of AddinStartupComplete... Should I move all that stuff to AddinInitialize?

Another question: adxregaddin is not supposed to be used instead of regsvr32, right?
Posted 08 Feb, 2010 06:58:07 Top
Andrei Smolin


Add-in Express team


Posts: 16466
Joined: 2006-05-11
Steve,

If you create a new add-in project and look at the setup project, you'll see cutom actions referring to adxloader.dll. Using regsvr32 is a complete analog of using those custom actions.

does that mean that I should not add any stuff to AddinStartupComplete ? The things that are happening when I unregister through regsvr32 are all things that are part of AddinStartupComplete...


That's strange. When you unregister the add-in, the module is created but no events are called. If thet are called for you then the add-in isn't unregestered at this moment. Moving the things to AddinInitialize will not help.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Feb, 2010 07:22:35 Top
skuske




Posts: 53
Joined: 2009-12-30
That is indeed strange. It's even stranger now that unregistering through regsvr32 no longer makes those things happen, i.e. the stuff fr om AddinStartupComplete is no longer executed, although it was before. I hate stuff like that wh ere things are not reproducable properly all the time. :(

I'll try if I can get this to happen again ... currently all is fine, although nothing was fine with unregistering before. I worked on this the last 3 days and was not able to get this to work as it should, and now for some reason all is fine. I must have changed something that I am not aware of at the moment.
Posted 08 Feb, 2010 07:42:04 Top
Andrei Smolin


Add-in Express team


Posts: 16466
Joined: 2006-05-11
OK. Please keep me notified about your progress.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Feb, 2010 08:13:06 Top
Heinz-Josef Bomanns




Posts: 206
Joined: 2008-02-28
Hi suske,

if you are indeed also using Setup Factory [...]

Yeep, i guess you refer to http://www.indigorose.com/forums/showthread.php?t=28855, a thread i started a while ago...

Hi Andrei,

That's why we always suggest moving all initialization-related things to AddinInitialize

This will lead to other problems: If the add-in has a time consuming initialization phase and the user is opening a DOC/XLS via double click in Windows Explorer, Word/Excel wouldn't start correctly - it'll display an error message telling that the file or one of it's components was not found or it leaves the user silently with an empty gray window. This is due to the old DDE stuff Windows Explorer is using to start Word/Excel and to open documents (or create new docs based on double clicked templates). It can't simply handle DDE requests and opening files at the same time. When doing that initialization stuff in "AfterStartupComplete" Word/Excel doesn't show this behaviour. So from my point of view moving initialization complete to AddInInitialize isn't the best solution...

Question is: Why are the files still locked after adxloader.dll has executed and quited? Probably it's a solution to call adxloader.dll.DLLRegister and adxloader.dll.DLLUnregister (found that in custom action view of the VS-setups) instead of using the DLL self registering/unregistering of the setup or regsvr32?
__________________
Greetings, HJB
Posted 08 Feb, 2010 09:29:41 Top
Heinz-Josef Bomanns




Posts: 206
Joined: 2008-02-28
suske writes:
now that unregistering through regsvr32 no longer makes those things

Have you tested your setup with Vista/2008/7 resp XP/2003 with limited user accounts? AFAIK running regsvr32 without admin rights wouldn't work?
__________________
Greetings, HJB
Posted 08 Feb, 2010 09:43:20 Top
skuske




Posts: 53
Joined: 2009-12-30
No, that's not what is causing this since I have not changed user priviledges on the test machine. It's a VMWare virtual Windows 7 machine with all the default account settings of an admin account. I have no idea why the 'in-use' problem suddenly went away.

What I have changed though, is this: in Setup Factory I unchecked the 'Register COM Interface' checkbox on the 'Advanced' tab of the adxloader.dll file settings. I then immediately clicked the 'Test' button next to the checkbox. Setup Factory then reported that adxloader.dll does support selfregistration (as expected). I then re-build the setup, and it is possible that this fixed it, although I do not understand why this should have fixed it, but this is all I can remember I changed in the setup before the issue went away.

Steve
Posted 09 Feb, 2010 01:42:40 Top
Andrei Smolin


Add-in Express team


Posts: 16466
Joined: 2006-05-11
Hi Steve,

skuske writes:
does that mean that I should not add any stuff to AddinStartupComplete ?


What I was trying to say is that you should not do any initializations before AddinInitilize is invoked. "Before" means "in the constructor" and "in initializers of class-level variables defined in the module". When you unregister the add-in using either regsvr32 or the custom action provided by Add-in Express, the module is created outside of the host application and if such initializations are not prepared to this, you may get unwanted results.

After the module is created and all related registry keys are found and deleted, the host application is run and all things that cannot be cleaned in any other way are cleaned using the object model of the host application.

Heinz-Josef Bomanns writes:
This will lead to other problems: If the add-in has a time consuming initialization phase and the user is opening a DOC/XLS via double click in Windows Explorer, Word/Excel wouldn't start correctly - it'll display an error message telling that the file or one of it's components was not found or it leaves the user silently with an empty gray window. This is due to the old DDE stuff Windows Explorer is using to start Word/Excel and to open documents (or create new docs based on double clicked templates). It can't simply handle DDE requests and opening files at the same time.


Can you point me to the page that confirms this? All problems related to starting the host application via double click in Windows Explorer (or on desktop) that our customers ran into were solved by moving custom initializations to the AddinInitialize event of the module.

Heinz-Josef Bomanns writes:
AFAIK running regsvr32 without admin rights wouldn't work?


Administrative permissions are required for a per-machine add-in only. When created by the COM add-in project wizard, such an add-in has the following set of properties/attributes:

Add-in module. RegisterForAllUsers = true
adxloader.dll.manifest. privileges = "administrator"
setup. PostBuildEvent = "{path to Add-in Express}\Bin\DisableUAC.exe" "$(BuiltOuputPath)" /UAC=On
setup. Application Folder. DefaultLocation = [ProgramFilesFolder][Manufacturer]\[ProductName]

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Feb, 2010 09:19:42 Top
Heinz-Josef Bomanns




Posts: 206
Joined: 2008-02-28
Hi Andrei,

Can you point me to the page that confirms this?


There's no such page, it's just my experience - and i should have say "This may lead to other problems". Since 1998 I've developed more than 200 add-ins for Word, Excel, Outlook and Access, started with DOTs/XLAs for Word/Excel, than switched to VB6, now to VS/ADX/VB.NET. Lots of customers were moaning about this behaviour, especially those using Word and Excel. To solve the problem for affected add-ins i've moved initialization code from AddinInitialize to AfterStartupComplete and the problems were gone. As mentioned this only happens with add-ins having a complex and time consuming initialization phase, just initializing some variables doesn't cause the problems, but for e.g. reading/processing large files with settings or data or doing complex CommandBar additions and/or modifications leads to that behaviour. Interesstingly MS has changed the initialization of add-ins with Office 2010 - when an application is starting it first initializes all add-ins and after that processes DDE Requests, so for me it looks like they were aware of this problem. I'm currently in the process of porting some of the add-ins with large init phases to VS/ADX/VB.NET, will keep you informed how they behave regarding this DDE problems...
__________________
Greetings, HJB
Posted 10 Feb, 2010 22:48:29 Top
Andrei Smolin


Add-in Express team


Posts: 16466
Joined: 2006-05-11
Hi HJB,

Thank you very much for sharing your experience! Although I created twice as many add-ins in the last year, they were small enough and it looks I just had no chance to see that problem.

Heinz-Josef Bomanns writes:
will keep you informed how they behave regarding this DDE problems...


Many thanks in advance!

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Feb, 2010 09:37:23 Top