PDA

View Full Version : Create Shortcut under vista



NewsArchive
08-06-2008, 02:21 AM
Hi Friedrich,

I'm building a small simple install to install some Build Automator
examples. The install is set to AsInvoker since I need to install into the
user's MyDocuments folder. No problems. But it can't create a shortcut to
the project, presumably because it's set to AsInvoker. It's not a big deal,
but would be nice to be able to create the shortcut. Any ideas?

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-06-2008, 02:23 AM
I think there's a bug I once discussed with Friedrich - the "for everybody"
check box on the shortcut definition screen doesn't seem to work as
advertised.
But the $SB_ALLUSERSFLAG$ does work.
The attached works on my Vista machine.
HTH

Jane

NewsArchive
08-06-2008, 02:24 AM
Hi Jane,

> I think there's a bug I once discussed with Friedrich - the "for everybody"
> check box on the shortcut definition screen doesn't seem to work as
> advertised.

I'm only installing this for the current user.

> But the $SB_ALLUSERSFLAG$ does work.
> The attached works on my Vista machine.

It also works here, but I can't see what the $SB_ALLUSERSFLAG$ does or where
it's used - I see where it's set, but don't see it used anywhere. Don't
find it in the help either...

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-06-2008, 02:24 AM
Hi Jane,

> It also works here, but I can't see what the $SB_ALLUSERSFLAG$ does or where
> it's used - I see where it's set, but don't see it used anywhere. Don't
> find it in the help either...

Ok, found it in the help. Testing... Yep, worked - of course:)

But I didn't check the "for all users" and didn't expect it for all users,
so it seems there is something that prevents the installer from creating the
shortcut for the current user. The installer is running asInvoker.
Weird...

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-07-2008, 02:08 AM
As I said, I consider it a bug.
Based on my notes, I see I wrote about the problem in a thread in July of last year.

Jane

NewsArchive
08-07-2008, 02:10 AM
Link to thread: http://www.lindersoft.com/forums/showthread.php?t=2679

Jane Fleming

NewsArchive
08-07-2008, 02:10 AM
> As I said, I consider it a bug.
> Based on my notes, I see I wrote about the problem in a thread in July of
> last year.

I think it's "only" a documentation problem <g>

By default, the installer is running in "AllUser" mode.

If %_SB_INSTALLERFLAG% Equals "1" on Position "$SB_ALLUSERSFLAG$" Then
Display Message Box "Running in AllUser mode" -- ""
End


If the AllUser flag is set, all Shortcuts are created in the Common Group,
even if the "Enable Access for All Windows Users" is NOT marked.

If the AllUser flag is NOT set, Shortcuts are only created in the Common
Group if the "Enable Access for All Windows Users" is marked.

In the past, it was a good idea to use the "User Infor Dialog" and let the
user select between "Install for anyone who uses this computer" or "Only for
me" (Enable User Type Option checkbox). If "Only for me" is selected at
runtime, the AllUser flag is set to 0.

Does this make sense?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-07-2008, 02:10 AM
Hi Friedrich,

> In the past, it was a good idea to use the "User Infor Dialog" and let the
> user select between "Install for anyone who uses this computer" or "Only for
> me" (Enable User Type Option checkbox). If "Only for me" is selected at
> runtime, the AllUser flag is set to 0.

Either way it doesn't create the shortcut under vista. Don't know if it
makes a difference but I was installing into a folder that did not exist,
i.e. Programs|Build Automator|Examples|Shortcut

If you want me to I can try to duplicate this and send you the script.

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-07-2008, 02:11 AM
But the script I posted did work for you under Vista ?

Jane

NewsArchive
08-07-2008, 02:11 AM
Hi Jane,

> But the script I posted did work for you under Vista ?

Yes, and so did mine after I added the same $SB_ALLUSERSFLAG$ as you had in
your script.

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-07-2008, 02:12 AM
Arnór,

> Either way it doesn't create the shortcut under vista. Don't know if it
> makes a difference but I was installing into a folder that did not exist,
> i.e. Programs|Build Automator|Examples|Shortcut
>
> If you want me to I can try to duplicate this and send you the script.

So it does not create the Shortcut under the non-admin profile if you have
set the installer to "asInvoker"

-and-

1. AllUsers is set to 0

Set Installer Flag $SB_ALLUSERSFLAG$ to "0"

-and-

2. "Enable Access for All Windows Users" in the Shortcut is not marked?

If this is the case, it would be great if you could send me a small demo.

Thanks,
Friedrich

NewsArchive
08-07-2008, 02:12 AM
Hi Friedrich,

> So it does not create the Shortcut under the non-admin profile if you have
> set the installer to "asInvoker"
>
> -and-

Don't know about the "and" section - I created a new install, added couple
of files to it, added a shortcut, set the installer to "asInvoker"

> If this is the case, it would be great if you could send me a small demo.

I've emailed it to you:)

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-07-2008, 02:13 AM
Hi Arnór,

>
> I've emailed it to you:)
>

The following line is missing. Add it and you are done :)

Set Installer Flag $SB_ALLUSERSFLAG$ to "0"

Friedrich

NewsArchive
08-07-2008, 02:14 AM
No, as we e-mailed around the time of that former thread I personally do NOT
think it's a good idea to have a check box the understanding of which
requires extraordinary psychic powers <G>

Jane

NewsArchive
08-07-2008, 02:14 AM
> No, as we e-mailed around the time of that former thread I personally do
> NOT think it's a good idea to have a check box the understanding of which
> requires extraordinary psychic powers <G>

<G>

Yes, but if we would change this behavior then it's possible that scripts
would not be backward compatible any longer.

What would you suggest should be changed. The idea behind this method was
(in 2000, 2003, XP) that (by default) the installer runs in AllUser
installation mode and created the Shortcut in the Common User profile. If
the user selected "Install only for me" then the installer created the
Shortcut in the User profile. But the developer had the power to create
specific Shortcuts in the All User profile (I think this feature was added
on request in late 2005).

Friedrich

NewsArchive
08-08-2008, 01:21 AM
Hi Friedrich,

> The following line is missing. Add it and you are done :)
>
> Set Installer Flag $SB_ALLUSERSFLAG$ to "0"

I know, but why do I need it? It's not set to create the shortcut for all
users.

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-08-2008, 01:21 AM
Arnor...
Stay with us!
We're trying to teach you the SECRET CODE!!!! <g>

The truth table Friedrich is using is something like this
default installation has $SB_ALLUSERSFLAG$ set to 1

if $SB_ALLUSERSFLAG$=1 and 'all users' check box =1, set to all users
if $SB_ALLUSERSFLAG$=1 and 'all users' check box=0, set to all users
if $SB_ALLUSERSFLAG$=0 and 'all users' check box=1, set to all users
if $SB_ALLUSERSFLAG$=0 and 'all users' check box=0, set to this user


Jane (i.e., your secret decoder ring <g>)

NewsArchive
08-08-2008, 01:22 AM
Hi Arnór,

>> The following line is missing. Add it and you are done :)
>>
>> Set Installer Flag $SB_ALLUSERSFLAG$ to "0"
>
> I know, but why do I need it? It's not set to create the shortcut for all
> users.

Because some years ago quite a few users had to create Shortcuts in the
Common User profile when doing Current User installations. This option made
it possible to handle this.

So exactly what Jane said. In SetupBuilder 5 and 6:

if $SB_ALLUSERSFLAG$=1 and 'all users' check box=1, set to all users
if $SB_ALLUSERSFLAG$=1 and 'all users' check box=0, set to all users
if $SB_ALLUSERSFLAG$=0 and 'all users' check box=1, set to all users
if $SB_ALLUSERSFLAG$=0 and 'all users' check box=0, set to this user

In SetupBuilder 7, it will be:

if $SB_ALLUSERSFLAG$=1, set to all users
if $SB_ALLUSERSFLAG$=0, set to this user

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-08-2008, 01:23 AM
Hi Friedrich,

> Because some years ago quite a few users had to create Shortcuts in the
> Common User profile when doing Current User installations. This option made
> it possible to handle this.
....
> if $SB_ALLUSERSFLAG$=0, set to this user

This is not making sense to me... It seems logical to me that when creating
a shortcut that is NOT set up to be created for all users that it would do
this automatically and place it in the current user menu. By not setting
the shortcut up for All users it should do this automatically. If users
need this into the common, then they can check the "Create for all users"
Seems to me that that option is redundant if this has to be set in code...
What am I missing, part from needing more coffee?<g>

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-08-2008, 01:23 AM
Arnór,

>> Because some years ago quite a few users had to create Shortcuts in the
>> Common User profile when doing Current User installations. This option
>> made it possible to handle this.
> ....
>> if $SB_ALLUSERSFLAG$=0, set to this user
>
> This is not making sense to me... It seems logical to me that when
> creating a shortcut that is NOT set up to be created for all users that
> it would do this automatically and place it in the current user menu.
> By not setting the shortcut up for All users it should do this
> automatically. If users need this into the common, then they can check
> the "Create for all users" Seems to me that that option is redundant if
> this has to be set in code...
> What am I missing, part from needing more coffee?<g>

Some years ago this was a very useful function (install Shortcut to the All
User profile while running the installer in Current User mode). Not so in
the modern world <g>.

That's why we'll remove the "Enable Access for All Windows Users" checkbox
option in the "SetupBuilder 7" Shortcut Properties (see my other post for
more detailed information).

Friedrich

NewsArchive
08-08-2008, 01:25 AM
What I'd suggest is making it comprehensible to your typical user.
That I beat my head against this "feature" a year ago is understandable.
But that it confused Arnor is beyond the pale! <g>

1. Get rid of the check box on each shortcut's properties, in that the
behavior of not doing anything unless somebody sets a secret switch
elsewhere is not at all intuitive.
2. Have the $SB_ALLUSERSFLAG$ be the only determining factor. That can
still give the ability to create some shortcuts as "all users" if needed (as
in attached script).
3. Perhaps add a Set/Clear All Users script item so it's easier to find
than as it presently hides as one of the choices in the Set Installer Flag
item. Or if not, put a link on the shortcut properties page that opens a
page in the documentation explaining how to set/clear this.

This does beg the question of backward-compatibility. You might leave the
internal behavior the same so existing scripts would work as before, but
with the check boxes no longer on the shortcut properties screen no new
people would stub their toes on this "feature".


The "feature" word I've been highlighting reminds me of many years ago when
I worked at a television station. We were getting a sales pitch for a new
video switcher (I think Europeans call them "vision mixers"). This was an
entirely analog world (circa 1982...). One of the video transitions had
been named by the engineers "Special Defect" (as a play on words versus
"special effect") because it had been discovered by accident when some
circuit went into a feedback condition.
Talk about truth in advertising...LOL... Eventually, their marketing
department required that they rename it....

Jane

NewsArchive
08-08-2008, 01:27 AM
> What I'd suggest is making it comprehensible to your typical user.
> That I beat my head against this "feature" a year ago is understandable.
> But that it confused Arnor is beyond the pale! <g>

<BG>

> 1. Get rid of the check box on each shortcut's properties, in that the
> behavior of not doing anything unless somebody sets a secret switch
> elsewhere is not at all intuitive.
> 2. Have the $SB_ALLUSERSFLAG$ be the only determining factor. That can
> still give the ability to create some shortcuts as "all users" if needed
> (as in attached script).
> 3. Perhaps add a Set/Clear All Users script item so it's easier to find
> than as it presently hides as one of the choices in the Set Installer Flag
> item. Or if not, put a link on the shortcut properties page that opens a
> page in the documentation explaining how to set/clear this.
>
> This does beg the question of backward-compatibility. You might leave the
> internal behavior the same so existing scripts would work as before, but
> with the check boxes no longer on the shortcut properties screen no new
> people would stub their toes on this "feature".

Okay, if there are no objections <g>, I'll remove the "Enable Access for
All Windows Users" checkbox from the Shorcut properties in SetupBuilder 7.

Then, in SetupBuilder 7, if the "AllUser" mode is enabled (and that is by
default), Shortcuts and Add/Remove Panel entries are created in the Common
User profile. If it is disabled, then Shortcuts and Add/Remove Panel
entries are created in the Current User profile.

>
> The "feature" word I've been highlighting reminds me of many years ago
> when I worked at a television station. We were getting a sales pitch for
> a new video switcher (I think Europeans call them "vision mixers"). This
> was an entirely analog world (circa 1982...). One of the video
> transitions had been named by the engineers "Special Defect" (as a play
> on words versus "special effect") because it had been discovered by
> accident when some circuit went into a feedback condition.
> Talk about truth in advertising...LOL... Eventually, their marketing
> department required that they rename it....

<G>

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-08-2008, 01:27 AM
Ahhh... a man who lives with two women has learned how to respond to
nagging <G>

Sounds good to me, Friedrich :)

Jane

NewsArchive
08-08-2008, 01:27 AM
> Ahhh... a man who lives with two women has learned how to respond to
> nagging <G>
>
> Sounds good to me, Friedrich :)

<VBG> :)

Friedrich

NewsArchive
08-08-2008, 01:28 AM
Hi Friedrich,

> Okay, if there are no objections <g>, I'll remove the "Enable Access for
> All Windows Users" checkbox from the Shorcut properties in SetupBuilder 7.

I would do it the other way - have "Current user" be the default and let the
All Window users do the common stuff. That's how I understood the setting.
Since I wanted it only for the current user, it didn't dawn on me that
leaving the checkbox unchecked didn't do exactly what I wanted. I'm not
sure what it did, but it wasn't what I expected<g>

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-08-2008, 01:29 AM
Hi Friedrich,

> I would do it the other way - have "Current user" be the default and let the

Or I'd set it to all users and have a "For current user only" as a checkbox
on the create shortcut function. I don't care which one as long as it makes
sense;)

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-08-2008, 01:30 AM
Hi Arnór,

>> I would do it the other way - have "Current user" be the default and let
>> the
>
> Or I'd set it to all users and have a "For current user only" as a
> checkbox on the create shortcut function. I don't care which one as long
> as it makes sense;)

I think I have to give some more detailed information to describe what is
going on behind the scenes.

By default, an installation is running in "All User" mode. That means, all
Shortcuts and Add/Remove Control Panel entries are created in the Common
User profile.

In the past, it was recommended (by Microsoft) to provide an option and let
the user choose whether the software should be installed for "all users" or
only for the "current user". Most developers displayed such a "Select User
Type" dialog in their NT/2000/XP installations.

See attached UserInfo.jpg screenshot.

If "Anyone who uses this computer (all users)" is selected, the User Info
dialog set $SB_ALLUSERSFLAG$=1. Shortcuts and Add/Remove Panel entries go
into the Common User profile.

If "Only for me (Friedrich Linder)" is selected, the User Info dialog set
$SB_ALLUSERSFLAG$=0. Shortcuts and Add/Remove Panel entries go into the
Current User profile.

You don't have to do anything here. SetupBuilder handles this
automatically.

If the "Select User Type" dialog is not displayed, the default is
$SB_ALLUSERSFLAG$=1, but can be changed programmatically with the "Set
Installer Flag" script function.

But some years ago (I think in 2002 or 2003), customers requested an option
so they can install the Shortcut into the "All User" profile even if the
"Only for me (Friedrich Linder)" was selected. So we introduced the "Enable
Access for All Windows Users" checkbox option in the Shortcut Properties.

What we'll do in SetupBuilder 7 is, we'll remove this "Enable Access for
All Windows Users" checkbox option in the Shortcut Properties because it
seems to be confusing nowadays.

Hope the above makes it a bit clearer.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-10-2008, 07:04 AM
Hi Friedrich,

> But some years ago (I think in 2002 or 2003), customers requested an option
> so they can install the Shortcut into the "All User" profile even if the
> "Only for me (Friedrich Linder)" was selected. So we introduced the "Enable
> Access for All Windows Users" checkbox option in the Shortcut Properties.
>
> What we'll do in SetupBuilder 7 is, we'll remove this "Enable Access for
> All Windows Users" checkbox option in the Shortcut Properties because it
> seems to be confusing nowadays.

Since it is in all users mode, why not have a checkbox on the shortcut "For
current user only"? Seems perfectly logical to me...

In this particular case I don't want an option in the installer because I
don't think the asinvoker installer could write to the all users menu
folder.

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-10-2008, 07:05 AM
Hi Arnór,

> Since it is in all users mode, why not have a checkbox on the shortcut
> "For
> current user only"? Seems perfectly logical to me...

Because in AllUser mode, you can only write Shortcuts and Add/Remove Control
Panel items to the AllUser profile from the installer ;-)

> In this particular case I don't want an option in the installer because I
> don't think the asinvoker installer could write to the all users menu
> folder.

That's correct. To successfully add your Shortcut to the Current User
profile from the asInvoker installer, you have to add the "Set Installer
Flag $SB_ALLUSERSFLAG$ to "0" line. This brings the installer into Current
User mode.

BTW, please note that an asInvoker installer can also execute elevated.

Does it make more sense now?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-10-2008, 07:05 AM
Hi Friedrich,

> That's correct. To successfully add your Shortcut to the Current User
> profile from the asInvoker installer, you have to add the "Set Installer
> Flag $SB_ALLUSERSFLAG$ to "0" line. This brings the installer into Current
> User mode.
>
> BTW, please note that an asInvoker installer can also execute elevated.
>
> Does it make more sense now?

Yes... and no<g> I understand what you are saying but I don't like having
to go set some variables just to get a shortcut installed correctly. Could
this be an option in project? That would default to "All users" but could
be set to "Current user" and it would set the $SB_ALLUSERSFLAG$ ? In my
case I want it off, so I would expect a checkbox somewhere

This get's a bit convoluted when you have: Installer in a certain mode
(current user/all users), installing into current user folders, creating
menus for current user and as invoker installer<g> Who's on first?<g>

Of course you must realize that this is all your fault for spoiling us with
SB<g>

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-10-2008, 07:06 AM
Hi Arnór,

>> Does it make more sense now?
>
> Yes... and no<g> I understand what you are saying but I don't like having
> to go set some variables just to get a shortcut installed correctly.
> Could this be an option in project? That would default to "All users" but
> could be set to "Current user" and it would set the $SB_ALLUSERSFLAG$ ?
> In my case I want it off, so I would expect a checkbox somewhere

But you only have to add one (1) line!!! <g>

Set Installer Flag $SB_ALLUSERSFLAG$ to "0"

This will switch the installer into "Current User" mode. And the good thing
is, you can use that function programatically. You can use it to swith it
on/off at runtime!

And it's not only the Shortcut - this mode will also place the "Add/Remove"
Control Panel entries into a different location!

Today, about 99.99% of all installations are AllUser installations. Can you
imagine what would happen if we would add such a "All Users/Current User"
combo to the "General Information" screen and Joe User plays with it. We
have (at least) 50 support requests per week because developers change the
manifest from "requireAdministrator" to "asInvoker" and then realize (after
sending CDs out to their customers) that the installer cannot write to
Program Files, HKEY_LOCAL_MACHINE, etc. on Vista.

So this "Current User" option is only for developers who know what they are
doing.

> This get's a bit convoluted when you have: Installer in a certain mode
> (current user/all users), installing into current user folders, creating
> menus for current user and as invoker installer<g> Who's on first?<g>
>
> Of course you must realize that this is all your fault for spoiling us
> with SB<g>

<G>

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner