469,140 Members | 1,350 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

Setting up shortcuts in installer

Hi,

I have built a setup project to install an application I
am developing. I would like to be able to prompt the user
whether to install Shortcuts in the following locations:
* Start Menu
* Desktop
* Quick Launch

I have added a UI page that has three checkboxes on it to
let the user choose which shortcuts to install. However,
it seems that a shortcut does not have a Condition
property that I can use to conditionally include the
shortcut based upon a user input.

I have gotten around this by using a hack (making three
copies of the startup executable, setting the condition
property on each, and pointing each of the three
shortcuts to a different target -- if a target is not
created, the corresponding shortcut is not either) but I
need a better solution.

What is the best way to go about this? I started down the
path of letting it create all three shortcuts, then
deleting the unwanted ones in a custom action, but that
seems error-prone.

Thanks,
Luke Wright
Jul 21 '05 #1
6 9126
Hi Luke,

Thanks for posting.

We don't have a formal way to achieve this goal within VS.Net. However, we
can use Platform SDK tools to do this.

I will get back to you as soon as possible with detailed steps.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #2
Hi Luke,

I will give you an example on creating a shortcut on desktop only:

1. Create a MSI for your project using VS.Net. Add a "Checkboxes" dialog.
Add a shortcut for the primary output in "Program Menu"

2. Go to the following site to downloand and install Windows Installer SDK:

http://www.microsoft.com/msdownload/...sdk/sdkupdate/

3. Install "Orca.msi" included.

4. Use "Orca.exe" to open the MSI file we have generated.

5. Open "Component" table. There should be one row generated by VS.Net.
Add one row:

Component: Component_Desktop

Component_ID: {E93098AA-E938-54EC-EEAC-6383E471F0EF}
(This is in fact a GUID. We can get one from the existing component and
change one bit.)

Condition: CHECKBOXA1
(This should be consistent to the property of our check box in VS.Net.)

Leave other fields the same as the existing row.

6. Open "FeatureComponents" table. Add one row:

Feature: DefaultFeature

Component: Component_Desktop

7. Open "Shortcut" table. There should be one row for the shortcut we have
created in Program Menu. Add one row:

Shortcut: Shortcut_Desktop

Directory: DesktopFolder

Component: Component_Desktop

Leave other fields the same as the existing row (or empty).

8. Save the MSI file and exit.

Please have a try and see whether this helps.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3
Felix,

I followed your instructions, - ran the resulting .msi file, and got a
2356 error. - which means "Couldn't locate cabinet in stream: [2]."
(errors on page: http://msdn.microsoft.com/library/de...ons_action.asp)

It appears that the new .msi file that orca saved is about 50% smaller
than the original .msi file, and I am suspecting that somehow some of
the enclosed contents weren't saved back to the new file.

Do you know how to avoid this truncation when saving from orca?

thanks

Anatoly
v-*****@online.microsoft.com (Felix Wang) wrote in message news:<Oj**************@cpmsftngxa06.phx.gbl>...
Hi Luke,

I will give you an example on creating a shortcut on desktop only:

1. Create a MSI for your project using VS.Net. Add a "Checkboxes" dialog.
Add a shortcut for the primary output in "Program Menu"

2. Go to the following site to downloand and install Windows Installer SDK:

http://www.microsoft.com/msdownload/...sdk/sdkupdate/

3. Install "Orca.msi" included.

4. Use "Orca.exe" to open the MSI file we have generated.

5. Open "Component" table. There should be one row generated by VS.Net.
Add one row:

Component: Component_Desktop

Component_ID: {E93098AA-E938-54EC-EEAC-6383E471F0EF}
(This is in fact a GUID. We can get one from the existing component and
change one bit.)

Condition: CHECKBOXA1
(This should be consistent to the property of our check box in VS.Net.)

Leave other fields the same as the existing row.

6. Open "FeatureComponents" table. Add one row:

Feature: DefaultFeature

Component: Component_Desktop

7. Open "Shortcut" table. There should be one row for the shortcut we have
created in Program Menu. Add one row:

Shortcut: Shortcut_Desktop

Directory: DesktopFolder

Component: Component_Desktop

Leave other fields the same as the existing row (or empty).

8. Save the MSI file and exit.

Please have a try and see whether this helps.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #4
Hi Anatoly,

Thanks for posting. However I don't think that modifying the tables as I
suggest in the previous post will cause the MSI becomes 50% smaller. I have
also been using Orca for some time and generally it does not truncate the
MSI package (except for file system failures).

Based on the error message, it seems that your issue is related to cabinet.
Cab files are stored in a hidden table "_Streams" and are their information
is recoreded in the "Media" and "File" table. There does not seem to be a
direct relation to the original shortcut issue. It is likely that a Cab
file is not properly imported into the "_Streams" table here.

I suggest that you first test my steps on a bare-bone VS.Net MSI. If they
work, then let's apply the steps to a more complicated MSI.

I hope this helps.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #5
Felix,

Evidently Orac doesn't copy all streams when you do "Save As.." which
is what I used by mistake. If you save into original file, it works
fine.

http://groups.google.com/groups?hl=e...TNGP11.phx.gbl

-Anatoly

v-*****@online.microsoft.com (Felix Wang) wrote in message news:<QD**************@cpmsftngxa06.phx.gbl>...
Hi Anatoly,

Thanks for posting. However I don't think that modifying the tables as I
suggest in the previous post will cause the MSI becomes 50% smaller. I have
also been using Orca for some time and generally it does not truncate the
MSI package (except for file system failures).

Based on the error message, it seems that your issue is related to cabinet.
Cab files are stored in a hidden table "_Streams" and are their information
is recoreded in the "Media" and "File" table. There does not seem to be a
direct relation to the original shortcut issue. It is likely that a Cab
file is not properly imported into the "_Streams" table here.

I suggest that you first test my steps on a bare-bone VS.Net MSI. If they
work, then let's apply the steps to a more complicated MSI.

I hope this helps.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #6
Hi Anatoly,

Thanks for the information. Previously I was not aware of this, as I always
copy the file first and then edit it.

If you have any concerns regarding my steps, please feel free to post.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Luke Wright | last post: by
reply views Thread by SPE - Stani's Python Editor | last post: by
reply views Thread by TC | last post: by
reply views Thread by GeorgeF | last post: by
3 posts views Thread by Michael D. Murphy | last post: by
3 posts views Thread by sagar | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.