which folder are add-ins running from

J

JS.

hi, all,

I have created an add-in for powerpoint. it works fine with i run it
directly from the VSTO (visual studio tool for office) .

However, when i deploy it using windows installer, and run PowerPoint
directly, there is some problems when I use the add-in. The add-in need to
access some files in a subfolder. Although I pack create the subfolder in the
windows installer, seems the add-in cannot load the file in the subfolder.

So, my question is whether the add-in is running from its installation
folder or some other folders?

Please advise. Thanks.
 
A

Austin Myers

Did you set the folders permissions? Where did you tell the installer to
put it?


Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
J

JS.

Thanks Austin for your reply.

I install the add-in in d:\program files\<add_in_name>. inside this folder,
there is a sub-folder called "icon", and the add-in should load some files
from this "icon" sub-folder when a button of the add-in is clicked. When I
open the PowerPoint directly, the add-in is loaded automatically without
error. However, when I clicked the button, the error appears because it
doesn't load file correctly.

Any advice?

Thanks.

JS.
 
A

Austin Myers

JS. said:
Thanks Austin for your reply.

I install the add-in in d:\program files\<add_in_name>. inside this
folder,
there is a sub-folder called "icon", and the add-in should load some files
from this "icon" sub-folder when a button of the add-in is clicked. When I
open the PowerPoint directly, the add-in is loaded automatically without
error.

Are you CERTAIN of this? You may well have an entry in your menu from a
previous build/test but it still may not be loading properly. I suggest
looking at the registry and see what its load behavior is set at. Then I
would clear the menu 9reset to default) close PPT and try firing it again to
see if it creates th proper menus.



Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins





However, when I clicked the button, the error appears because it
 
A

Austin Myers

Another thought, have you installed the VSTO runtime on all the target
machines?


Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
J

JS.

hi, Austin,

Yes, I have cleaned the build from Visual Studio, and rebuild the whole
thing for many times. But the problem still there.

the load behavior is set to be 3.

JS.
 
J

JS.

yes. i did

Austin Myers said:
Another thought, have you installed the VSTO runtime on all the target
machines?


Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
A

Austin Myers

JS. said:
hi, Austin,

Yes, I have cleaned the build from Visual Studio, and rebuild the
whole
thing for many times. But the problem still there.

the load behavior is set to be 3.


There is your problem, load behavior MUST be a 2. Change it and try
starting PPT again. If it does not load, look at the reg and if it has
changed back to a 3 it is NOT being loaded and the menu you see is a left
over.

Is this on Vista systems or XP?


Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
A

Austin Myers

There is your problem, load behavior MUST be a 2. Change it and try
starting PPT again. If it does not load, look at the reg and if it has
changed back to a 3 it is NOT being loaded and the menu you see is a left
over.

Is this on Vista systems or XP?

Follow Up... What cause the load behavior to change?

If for ANY reason PPT can't load everything it changes the reg setting.
Reasons can include.

You didn't grant permission to the folder.
User is not logged in properly. (With Vista if Sally installed it Bob can
not use it.)
You used a control that is not present on the target machine.
You used the wrong Office DLL
You used the wrong version of VSTO
You used the wrong PPT version template in VS.
You did not have everything needed in the setup project.

There are more but I would start with these.
 
J

JS.

hi, Austin,

Just tried to change load behavior to 2. However, the add-in didnt
appear after changing to 2.

The add-in is created using VSTO. Inside the code, I created a
customtaskpane. Everything works fine when I run directly from the visual
studio. When press F5, PowerPoint will be loaded automatically, and the
add-in is also loaded, and works as expected. When I click the button on the
customtaskpane, some files inside the "icon" folder (I put in under the
bin\debug folder) will be loaded for computation.

The problem now is that the add-in does not run correctly when I open
PowerPoint directly. The customtaskpane is loaded. However, when I click a
button in the customtaskpane, I'm prompted that the files cannot be loaded.
The "icon" sub-folder has already been created during the deployment using
Windows Installer, and all the needed files are copied into the folder.

Any idea? Thanks.

JS.
 
A

Austin Myers

It really sounds like a permissions issue. Unfortunately without really
looking at your project, how you have it structured, what the setup
includes, etc. its just too hard to even guess why its happening.



Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
J

JS.

hi, Austin,

Maybe we dont talk about the setup first.

Everything works fine with I run the add-in from Visual Studio
directly, since the build process with VSTO will deploy the add-in
automatically on local machine. However, when I try to open PowerPoint
directly in the same development PC, the problem appears. The customtaskpane
shows. But when I clicked the button, the file doesnt get loaded.

If it is the permission issue, how to change the setting? Thanks.

JS.
 
A

Austin Myers

Which OS are we looking at? (XP/Vista) If you look at the folders
permissions what does it tell you?

I know you suggested forgetting the setup part of your project but that is
where you set your file/folder permissions. (Note, you must do this as VS
does NOT do it on its own with Click Once deployment when it comes to Office
add-ins.) Also, if you are using any registry settings you must also have
permission to access them as you want. This too must be set with your setup
project. It sounds as if you have permission to run the add-in, but it does
not have permission to access the file in its current location.

Keep in mind, you MUST be the machines administrator to make these changes
and you must take into account any system wide "policies" put in place by
your IT folks.

You might want to take a look at this:
http://msdn.microsoft.com/en-us/library/system.security.permissions.fileiopermission.aspx


Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
J

JS.

hi, Austin,

Am using a XP system.

Which folder do you mean? The folder that I run the add-in directly
from VSTO or the one I installed the add-in to using the setup project? In
both cases, "Administrators", "SYSTEM", "<my_user_name>", and "CREATOR OWNER"
have full control over this folder, while other normal users have "read and
excuete" right. Anything wrong with the permission here?

one thing i may forget to mention is that, after I click the button in
the customtaskpane, it will call some function in a unmanaged DLL. And inside
this unmanaged DLL, some local files will be loaded for computation. Any
special consideration needed for unmanaged DLL?

Regards,

JS.
 
J

JS.

hi, Austin,

I used ProcessMon to monitor which folder that the add-in is trying to
find the files. And it seems that when I start PowerPoint (with the add-in
enabled) directly, the add-in will search for the files from my profile
folder (i.e. C:\Documents and Settings\<my_user_name>) instead of the folder
that the add-in is installed. After copying the files to my profile folder,
the add-in can be run with any error.

So I think I will need to create a sub-folder in my profile folder, and
copy the files over from the installer? Or is it possible to change the
setting that the add-in is looking for external files? Any idea?

Thanks for your help.

Regards,

JS.
 
A

Austin Myers

I used ProcessMon to monitor which folder that the add-in is trying
to
find the files. And it seems that when I start PowerPoint (with the add-in
enabled) directly, the add-in will search for the files from my profile
folder (i.e. C:\Documents and Settings\<my_user_name>) instead of the
folder
that the add-in is installed. After copying the files to my profile
folder,
the add-in can be run with any error.

So I think I will need to create a sub-folder in my profile folder,
and
copy the files over from the installer? Or is it possible to change the
setting that the add-in is looking for external files? Any idea?

Can you post the code your using to open the file?



Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
J

JS.

hi, Austin,

The unmanged DLL is provided by third-party, I dont have access to
the source code how the file is loaded.

The problem is that the file is loaded correctly from "bin\debug"
folder when I debug the add-in right from inside Visual Studio. However, the
file failed to load when I opened PowerPoint directly because it tried to
load the file from "C:\Documents and Setting\<my_account_name>".

Best Regards,

JS.
 
A

Austin Myers

JS. said:
hi, Austin,

The unmanged DLL is provided by third-party, I dont have access to
the source code how the file is loaded.

The problem is that the file is loaded correctly from "bin\debug"
folder when I debug the add-in right from inside Visual Studio. However,
the
file failed to load when I opened PowerPoint directly because it tried to
load the file from "C:\Documents and Setting\<my_account_name>".

Does the third party DLL have its own installer or are you simply placing it
on the machine. Are you registering the DLL? How are you granting it
permission?

When you are running the add-in from Visual Studios, it grants these
permissions on the assumption that as the coder you understand the dangers
of running unmanaged code. However when you actuialy install it on another
machine each component must be registered and the proper permissions
granted.



Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins
 
J

JS.

hi, Austin,

it does not have installer. I just copied it in the same folder as
the add-in. In fact, this DLL can be loaded by the add-in. The problem here
is that the DLL will load a local file from a subfolder under the same folder
that the add-in resides. This local file cannot be loaded correctly when I
start the PowerPoint directly. The error is thrown by the DLL, saying the
file cannot be located. But it can be loaded without any problem when I run
the add-in from the Visual Studio.

Regards,

JS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top