How to install sample docs with our AddIn - security restrictions

D

David Thielen

Hi;

Ok, how do we handle the following scenario:

1) The user of a computer does not have admin rights.
2) The setup program therefore has to Run As an admin user to install our
AddIn.
3) We have a bunch of sample documents. Since we don't know the user's My
Documents we cannot install them there.
4) This computer is used by 30 different people, all of whom use Word on it.
5) Only 1 uesr needs our AddIn.

The suggested way to handle this is to copy the documents to the user's My
Documents when they first run "our application". Well our application is a
Word AddIn so it runs anytime a user starts Word.

a) So we con't copy when Word starts - the other 29 users of the computer
are going to be mad. As is the corporate IT staff.

b) We can't copy the first time our AddIn is accessed as they way ti is
usually first accessed is by the user opening one of the sample documents. So
we need the samples there first.

How can we properly install our AddIn? Is there some way to get the logged
in user's My Documents as opposed to the RunAs My Documents during install?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
P

Patrick Schmid [MVP]

W

Wei Lu [MSFT]

Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Brad Smith

I'd probably do something like this:

- have the samples installed with the app in a "central" location, like where the add-in itself is.
- When Word launches, and your add-in's OnStartupComplete event handler is triggered, copy the samples to the current user's "My Documents" (presumably in a sub-folder)
- As soon as that's done, set a custom key in your own registry section under HKEY_CURRENT_USER (something like HKCU\Software\MyAddIn\SamplesInstalled=1)
- *Next* time Word launches, in OnStartupComplete, your add-in could check this registry key and, if set, skip the copying.

If the samples really need to be there all the time, then you can get fancy and include an "if exists" check on the samples as well as this registry key, so that if it's set but the files are missing (perhaps the user deleted them by mistake?), you can ask the user if he wants them restored. Or you can put a "Restore Samples" button in your Options dialog (to cover the case where the user has badly buggered up the samples and wants to start fresh).

Brad.
 
D

David Thielen

If you don't have admin rights it will not let you install an AddIn as that
is an application.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Do you need to install with admin rights?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




Hi;

Ok, how do we handle the following scenario:

1) The user of a computer does not have admin rights.
2) The setup program therefore has to Run As an admin user to install our
AddIn.
3) We have a bunch of sample documents. Since we don't know the user's My
Documents we cannot install them there.
4) This computer is used by 30 different people, all of whom use Word on it.
5) Only 1 uesr needs our AddIn.

The suggested way to handle this is to copy the documents to the user's My
Documents when they first run "our application". Well our application is a
Word AddIn so it runs anytime a user starts Word.

a) So we con't copy when Word starts - the other 29 users of the computer
are going to be mad. As is the corporate IT staff.

b) We can't copy the first time our AddIn is accessed as they way ti is
usually first accessed is by the user opening one of the sample documents. So
we need the samples there first.

How can we properly install our AddIn? Is there some way to get the logged
in user's My Documents as opposed to the RunAs My Documents during install?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
P

Patrick Schmid [MVP]

Only if you install your add-in into HKLM. If you install into HKCU then
only the user installing the add-in will get the add-in with sample
documents. It's a bit more work to get an add-in to install into HKCU
without any Vista UAC prompt, but it can be done. I have started a blog
series on how to do it (assuming that you are not using VSTO, but the
Extensibility project), but haven't had the time to finish it up yet.
I'll try to get to it soon.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




If you don't have admin rights it will not let you install an AddIn as that
is an application.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Do you need to install with admin rights?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




Hi;

Ok, how do we handle the following scenario:

1) The user of a computer does not have admin rights.
2) The setup program therefore has to Run As an admin user to install our
AddIn.
3) We have a bunch of sample documents. Since we don't know the user's My
Documents we cannot install them there.
4) This computer is used by 30 different people, all of whom use Word on it.
5) Only 1 uesr needs our AddIn.

The suggested way to handle this is to copy the documents to the user's My
Documents when they first run "our application". Well our application is a
Word AddIn so it runs anytime a user starts Word.

a) So we con't copy when Word starts - the other 29 users of the computer
are going to be mad. As is the corporate IT staff.

b) We can't copy the first time our AddIn is accessed as they way ti is
usually first accessed is by the user opening one of the sample documents. So
we need the samples there first.

How can we properly install our AddIn? Is there some way to get the logged
in user's My Documents as opposed to the RunAs My Documents during install?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
D

David Thielen

HKCU brings up another set of problems. I won't go into them but based on
them we decided to always install to the HKLM. That we are stuck with.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Only if you install your add-in into HKLM. If you install into HKCU then
only the user installing the add-in will get the add-in with sample
documents. It's a bit more work to get an add-in to install into HKCU
without any Vista UAC prompt, but it can be done. I have started a blog
series on how to do it (assuming that you are not using VSTO, but the
Extensibility project), but haven't had the time to finish it up yet.
I'll try to get to it soon.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




If you don't have admin rights it will not let you install an AddIn as that
is an application.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Do you need to install with admin rights?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed





Hi;

Ok, how do we handle the following scenario:

1) The user of a computer does not have admin rights.
2) The setup program therefore has to Run As an admin user to install our
AddIn.
3) We have a bunch of sample documents. Since we don't know the user's My
Documents we cannot install them there.
4) This computer is used by 30 different people, all of whom use Word on it.
5) Only 1 uesr needs our AddIn.

The suggested way to handle this is to copy the documents to the user's My
Documents when they first run "our application". Well our application is a
Word AddIn so it runs anytime a user starts Word.

a) So we con't copy when Word starts - the other 29 users of the computer
are going to be mad. As is the corporate IT staff.

b) We can't copy the first time our AddIn is accessed as they way ti is
usually first accessed is by the user opening one of the sample documents. So
we need the samples there first.

How can we properly install our AddIn? Is there some way to get the logged
in user's My Documents as opposed to the RunAs My Documents during install?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
P

Patrick Schmid [MVP]

Install the documents in a folder with the add-in and have the add-in
copy it to the appropriate folder in My Documents when it is opened the
first time?
Or you can use a setup bootstrapper that you wrote yourself. You could
have it set an environment variable with the path that your MSI can read
and use? Or chain two MSIs with the bootstrapper, one for the docs the
other one for the add-inb itself.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




HKCU brings up another set of problems. I won't go into them but based on
them we decided to always install to the HKLM. That we are stuck with.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Only if you install your add-in into HKLM. If you install into HKCU then
only the user installing the add-in will get the add-in with sample
documents. It's a bit more work to get an add-in to install into HKCU
without any Vista UAC prompt, but it can be done. I have started a blog
series on how to do it (assuming that you are not using VSTO, but the
Extensibility project), but haven't had the time to finish it up yet.
I'll try to get to it soon.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




If you don't have admin rights it will not let you install an AddIn as that
is an application.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




:

Do you need to install with admin rights?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed





Hi;

Ok, how do we handle the following scenario:

1) The user of a computer does not have admin rights.
2) The setup program therefore has to Run As an admin user to install our
AddIn.
3) We have a bunch of sample documents. Since we don't know the user's My
Documents we cannot install them there.
4) This computer is used by 30 different people, all of whom use Word on it.
5) Only 1 uesr needs our AddIn.

The suggested way to handle this is to copy the documents to the user's My
Documents when they first run "our application". Well our application is a
Word AddIn so it runs anytime a user starts Word.

a) So we con't copy when Word starts - the other 29 users of the computer
are going to be mad. As is the corporate IT staff.

b) We can't copy the first time our AddIn is accessed as they way ti is
usually first accessed is by the user opening one of the sample documents. So
we need the samples there first.

How can we properly install our AddIn? Is there some way to get the logged
in user's My Documents as opposed to the RunAs My Documents during install?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
D

David Thielen

Hi;

Install on first use won't work because it will then do it for any user that
open's word on that system.

I think your bootstrapper -> bootstrapper -> installer (and hold left hand
in the air unless it's a Tuesday) is what we are going to have to do. What a
mess. I wish MS would think this stuff through for AddIns as well as normal
apps where the copy on first use is clunky but not horribly complicated.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Install the documents in a folder with the add-in and have the add-in
copy it to the appropriate folder in My Documents when it is opened the
first time?
Or you can use a setup bootstrapper that you wrote yourself. You could
have it set an environment variable with the path that your MSI can read
and use? Or chain two MSIs with the bootstrapper, one for the docs the
other one for the add-inb itself.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




HKCU brings up another set of problems. I won't go into them but based on
them we decided to always install to the HKLM. That we are stuck with.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Patrick Schmid said:
Only if you install your add-in into HKLM. If you install into HKCU then
only the user installing the add-in will get the add-in with sample
documents. It's a bit more work to get an add-in to install into HKCU
without any Vista UAC prompt, but it can be done. I have started a blog
series on how to do it (assuming that you are not using VSTO, but the
Extensibility project), but haven't had the time to finish it up yet.
I'll try to get to it soon.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed





If you don't have admin rights it will not let you install an AddIn as that
is an application.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




:

Do you need to install with admin rights?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed





Hi;

Ok, how do we handle the following scenario:

1) The user of a computer does not have admin rights.
2) The setup program therefore has to Run As an admin user to install our
AddIn.
3) We have a bunch of sample documents. Since we don't know the user's My
Documents we cannot install them there.
4) This computer is used by 30 different people, all of whom use Word on it.
5) Only 1 uesr needs our AddIn.

The suggested way to handle this is to copy the documents to the user's My
Documents when they first run "our application". Well our application is a
Word AddIn so it runs anytime a user starts Word.

a) So we con't copy when Word starts - the other 29 users of the computer
are going to be mad. As is the corporate IT staff.

b) We can't copy the first time our AddIn is accessed as they way ti is
usually first accessed is by the user opening one of the sample documents. So
we need the samples there first.

How can we properly install our AddIn? Is there some way to get the logged
in user's My Documents as opposed to the RunAs My Documents during install?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

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