Click Once Install Defaults

A

Alan Gillott

Where can i find proper documentation of Click once install?

In particular I need to know why it installs the short cut in the wierdest
of places - on my test machine it's buried under the Manufacturer's
subdirectory: I need to change that to somewhere findable.
Similarly the module itself is buried inside an obscure directory - I want
it back in Program Files where I can find it. And ensure it is backed up
when I backup program files (please don't get me started on the MS backup
tools)...

How do I persuade it to distribute and install Com modules instead of just
the wrappers?

....and can one readily convert the the obscure .ms file back into an easy to
find Exe?

I only just avoided ranting on this unhelpful and obfusticated feature!

A
 
S

Steve Gerrard

Alan said:
Where can i find proper documentation of Click once install?

In particular I need to know why it installs the short cut in the
wierdest of places - on my test machine it's buried under the
Manufacturer's subdirectory: I need to change that to somewhere
findable. Similarly the module itself is buried inside an obscure directory -
I
want it back in Program Files where I can find it. And ensure it is
backed up when I backup program files (please don't get me started on
the MS backup tools)...

How do I persuade it to distribute and install Com modules instead of
just the wrappers?

...and can one readily convert the the obscure .ms file back into an
easy to find Exe?

I only just avoided ranting on this unhelpful and obfusticated
feature!

Don't know about more documentation. Based on your comments, I would suggest you
give it up immediately, and focus on building your own setup program. While you
can add files to the setup, and make them Included (Required) or some such, most
of the rest of your wish list is not on the table for a ClickOnce install, at
least in my experience. You pretty much try it out, see if it works for you, and
if not, move on to something else.
 
A

Alan Gillott

That was what I was afraid of. It wouldn't be too hard to coerce the VB 6
deployment wizard to do it for me. visual studio costs more than I earn in a
year so that is a non starter. It really is low class of MS to not include
the Installer with Express.
A
 
R

RobinS

Try searching MSDN. There's a whole section on ClickOnce Deployment. It's
only unhelpful and obfuscated to you.

The point of ClickOnce is to provide a basic installation opportunity. It
installs in obfuscated folders under the user's profile, thus not requiring
elevated privileges, and provides a shortcut under the Start Menu. You can
also find code out there that you can add to your app that installs a
shortcut on the desktop. To pick up incremental updates (one of the great
things about ClickOnce), the user has to run it from the shortcut.

You can define prerequisites to be installed, and install anything wrapped
in any kind of setup package, including (but not limited to) something like
InstallShield or even an msi.

Brian Noyes has an excellent book on clickOnce if you're interested -- it
covers all aspects of it.

RobinS.
GoldMail, Inc.
 
A

Alan Gillott

Thank you Robin
I might need to as I also have a number of helper OLE components that are
ripe for becoming net dll classes which need to be shared between
applications. My immediate concern is how to control where the start menu
shortcut is installed: on this machine it installed it "under" Toshiba.
Nobody in there right mind would think of looking for it there!
A
 
S

Steve Gerrard

Alan said:
Thank you Robin
I might need to as I also have a number of helper OLE components that
are ripe for becoming net dll classes which need to be shared between
applications. My immediate concern is how to control where the start
menu shortcut is installed: on this machine it installed it "under"
Toshiba. Nobody in there right mind would think of looking for it
there! A

I should have added in my first post that I do use Click Once, and have found it
quite useful. I don't really care where it chooses to store the program, since I
am going to let it keep track of it and take care of it.

You can add most any file into your project, which will get it listed in the
files of the ClickOnce setup. If you mark it as Include, it will go into the
distribution just fine. Relative paths will be preserved.

I had no trouble with the start menu shortcut; it went in under a new folder
with our company name. Maybe you missed a setting on that somewhere (assembly
properties, maybe)? I just tell the users how to copy the shortcut to their
desktop, on the theory that they should learn how to do that anyway.

I'm not sure if there is a provision for installing some assemblies into the GAC
rather than in the app specific folder. That might require a separate
installation.
 
R

RobinS

Steve Gerrard said:
I should have added in my first post that I do use Click Once, and have
found it quite useful. I don't really care where it chooses to store the
program, since I am going to let it keep track of it and take care of it.

You can add most any file into your project, which will get it listed in
the files of the ClickOnce setup. If you mark it as Include, it will go
into the distribution just fine. Relative paths will be preserved.

I had no trouble with the start menu shortcut; it went in under a new
folder with our company name. Maybe you missed a setting on that somewhere
(assembly properties, maybe)? I just tell the users how to copy the
shortcut to their desktop, on the theory that they should learn how to do
that anyway.

I'm not sure if there is a provision for installing some assemblies into
the GAC rather than in the app specific folder. That might require a
separate installation.

He can write a separate installer for the stuff he wants put into the GAC,
if it really needs to BE put into the GAC. And then he can have it run as a
prerequisite to the ClickOnce installation.

We're actually installing parts of DirectX, but including them as part of
our deployment as local dll's rather than installing them in the GAC. That
way, if someone deinstalls DirectX, or installs a different version, we're
not impacted.

It sounds like he wants the dll's to be available to multiple apps, though,
so it might be the GAC for him. I'd have to check Brian Noyes' CLickOnce
book. It seems to me that somewhere in there it says if you have multiple
apps using the same components, it only installs the component once. You can
see this if you look in your obfuscated CLickOnce installation folders. If
anyone is interested, post back and I'll see if I can find that info.

By the way, if you want it, I have code that will put a shortcut on the
desktop when the user runs the application after installing it the first
time, and it's a working ClickOnce shortcut. :)

RobinS.
GoldMail, Inc.
 
R

RobinS

In the Properties of the deployment (Publish Tab, Options button), the
Publisher Name is going to be the menu item, and the Product Name will be
the name of the application.

So if you set PublisherName to "GeorgyPeorgy" and make the ProductName
"LoveyDovey",
you will get a menu folder on your start menu called "GeorgyPeorgy", and the
menu item that they run to run the app will be called "LoveyDovey".

I also put some comments in the other post about your OLE components and
about shortcuts.

RobinS.
GoldMail, Inc.
------------------------------------------
 
S

Steve Gerrard

RobinS said:
It sounds like he wants the dll's to be available to multiple apps,
though, so it might be the GAC for him. I'd have to check Brian
Noyes' CLickOnce book. It seems to me that somewhere in there it says
if you have multiple apps using the same components, it only installs
the component once. You can see this if you look in your obfuscated
CLickOnce installation folders. If anyone is interested, post back
and I'll see if I can find that info.

Interesting, I had not heard that. How would it manage to keep track of where
the assembly was, if it was not in the GAC and not in the app folder? It seems
like havoc would reign if the user uninstalled the other app, and somehow that
dll has to now get put in the second app folder. Oh wait, maybe it just sees it
missing and downloads it from the install site again...
By the way, if you want it, I have code that will put a shortcut on
the desktop when the user runs the application after installing it
the first time, and it's a working ClickOnce shortcut. :)

I saw a link to one of those (I thought it was this thread??), but it seemed
pretty elaborate for just putting a shortcut on the desktop. But since you ask,
sure. :)
 
A

Alan Gillott

Yes! and the catch is that if you don't provide it it chooses a "default";
it's the default that's scary!
Publisher name
Specifies the name of the application's publisher (optional). If this box is
empty, the value of the computer's RegisteredOrganization property will be
used. If that value is null, the project name is used.
A
 
R

RobinS

LOL. Mine on one of my machines is "None of Your Business". THAT would be an
entertaining deployment folder!

RobinS.
----------------------------
 
R

RobinS

Steve Gerrard said:
Interesting, I had not heard that. How would it manage to keep track of
where the assembly was, if it was not in the GAC and not in the app
folder? It seems like havoc would reign if the user uninstalled the other
app, and somehow that dll has to now get put in the second app folder. Oh
wait, maybe it just sees it missing and downloads it from the install site
again...


I saw a link to one of those (I thought it was this thread??), but it
seemed pretty elaborate for just putting a shortcut on the desktop. But
since you ask, sure. :)

Please forgive the wrapping problem below. I had to convert this from C#, so
I hope it's ok. It does compile. It's just been a while since I was
fortunate enough to work in VB. :-(

You need to import these two namespaces:

Imports System.Deployment.Application
Imports System.Reflection


''' <summary>
''' This will create a Application Reference file on the users desktop
''' if they do not already have one when the program is loaded.
''' Check for them running the deployed version before doing this,
''' so it doesn't kick it when you're running it from Visual Studio.
''' </summary>
Shared Sub CheckForShortcut()
'see if they are running a deployed version rather than running from
VS
If
(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) Then
Dim ad As ApplicationDeployment =
ApplicationDeployment.CurrentDeployment
If (ad.IsFirstRun) Then 'first time user has run the app
Dim code As Assembly = Assembly.GetExecutingAssembly()
Dim company As String = String.Empty
Dim description As String = String.Empty
If (Attribute.IsDefined(code,
GetType(AssemblyCompanyAttribute))) Then
Dim ascompany As AssemblyCompanyAttribute = _
DirectCast(Attribute.GetCustomAttribute(code,
GetType(AssemblyCompanyAttribute)), _
AssemblyCompanyAttribute)
company = ascompany.Company
End If
If (Attribute.IsDefined(code,
GetType(AssemblyDescriptionAttribute))) Then
Dim asdescription As AssemblyDescriptionAttribute = _
DirectCast(Attribute.GetCustomAttribute(code,
GetType(AssemblyDescriptionAttribute)), _
AssemblyDescriptionAttribute)
description = asdescription.Description
End If
If (company.Length > 0 AndAlso description.Length > 0) Then
Dim desktopPath As String = String.Empty
desktopPath = _
String.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
_
"\", description, ".appref-ms")
Dim shortcutName As String = String.Empty
shortcutName = _
String.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs),
_
"\", company, "\", description, ".appref-ms")
System.IO.File.Copy(shortcutName, desktopPath, True)
End If
End If
End If
End Sub

It's a pretty handy piece of code. Our users like having a desktop shortcut.

Good luck.
RobinS.
GoldMail, Inc.
 
R

RobinS

Steve Gerrard said:
Interesting, I had not heard that. How would it manage to keep track of
where the assembly was, if it was not in the GAC and not in the app
folder? It seems like havoc would reign if the user uninstalled the other
app, and somehow that dll has to now get put in the second app folder. Oh
wait, maybe it just sees it missing and downloads it from the install site
again...

Forgot to answer this one.

If you look in the obfuscated folder where your deployment resides, you will
see a whole bunch of folders -- I think there's one for each dll that you
deploy.

For example, our application uses DirectX deployed locally (not put in the
GAC), and although I have two versions of the app installed (because
ClickOnce lets you back the most current one out if it's not a forced
upgrade), I only have one folder for DirectX, called something like
micr...bunchofobfuscated stuff.

Both of my gmst...ion... folders have DirectX*.dll in them as well.

I'll have to look through Brian Noyes' ClickOnce book to find the reference
I'm looking for that talked about those folders not being created multiple
times. I'll see what I can find, and report back one way or the other.

RobinS.
GoldMail, Inc.
 
S

Steve Gerrard

RobinS said:
Forgot to answer this one.

If you look in the obfuscated folder where your deployment resides,
you will see a whole bunch of folders -- I think there's one for each
dll that you deploy.

For example, our application uses DirectX deployed locally (not put
in the GAC), and although I have two versions of the app installed
(because ClickOnce lets you back the most current one out if it's not
a forced upgrade), I only have one folder for DirectX, called
something like micr...bunchofobfuscated stuff.

I did look, and did notice that only three or four dlls have two copies, the
rest are down to one. I'm still curious if that can be coordinated between two
different apps. Thanks for looking into it...
 
S

Steve Gerrard

RobinS said:
Please forgive the wrapping problem below. I had to convert this from
C#, so I hope it's ok. It does compile. It's just been a while since I was
fortunate enough to work in VB. :-(

(code snipped)
It's a pretty handy piece of code. Our users like having a desktop
shortcut.

Thanks! I will probably work it over and see if I can use the My namespace in a
few places. I think I can use Application.Info, for instance. That might
"cheapen" it a little, but it will make it easier for me to remember what it is
doing. :)

By the way, got any bright ideas on changing a ClickOnce app to a new digital
signature? I have googled it, and found various things, but nothing so far that
is very appetizing. Or is there something new on that in VS 2008?
 
R

RobinS

Steve Gerrard said:
(code snipped)


Thanks! I will probably work it over and see if I can use the My namespace
in a few places. I think I can use Application.Info, for instance. That
might "cheapen" it a little, but it will make it easier for me to remember
what it is doing. :)

By the way, got any bright ideas on changing a ClickOnce app to a new
digital signature? I have googled it, and found various things, but
nothing so far that is very appetizing. Or is there something new on that
in VS 2008?

Ugh, I have the same problem. We have thousands of customers, and I have
until July to figure out a way to update our certificate without making
everybody uninstall and reinstall.

Someone posted a comment to one of these groups that this is fixed in
VS2008, but color me skeptical. I've actually sent an e-mail to Brian Noyes
(who wrote the ClickOnce book) asking that very question. And I think I
saved something somewhere about it. I'll see if I can track it down. If I
have to, I have friend at MSFT who knows some ClickOnce people... I'll
report back. I have to say, that is the most unfortunate feature of
ClickOnce deployment.

RobinS.
GoldMail.com
 

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