Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to modify MSI using Orca to hard-code location of startup shortcut

Posted on 2009-04-07
16
5,178 Views
Last Modified: 2013-11-14
My MSI currently inserts the startup shortcut for the app in the Startup Menu.

I'd like to modify the MSI so that the startup shortcut gets inserted in a different hard-coded location (C:\Documents and Settings\All Users\Start Menu\Programs\Company Applications) rather than being inserted in the currently-defined StartMenuFolder.

I've attached screen shots of the Orca Shortcut and Directory tables.
OrcaScreenShots.png
0
Comment
Question by:wjm013
  • 9
  • 7
16 Comments
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 24094883
In the Directory table create the following line:
Directory: newfolder1
Directory Parent: ProgramMenuFolder
Default Dir: COMPAN~1|Company Applications

In the Shortcut table simply chage the Directory value from StartMenuFolder (as shown in printscreen) to newfolder1

Hope this helps.
0
 

Author Comment

by:wjm013
ID: 24098638
I get "Internal Error 2705. Directory" when I launch the MSI.

Orca validation reports an ICE03 error: "Not a valid foreign key; Table:Directory, Column: Directory_Parent, Key(s):newfolder1"

The "ProgramMenuFolder" text appears in red in the Orca view of the Directory table.

Please see the attached file.
OrcaScreenShot03.png
0
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 24104957
You encounter this validation error, because the ProgramMenuFolder is not present itself in the directory table. Normally it should be there for any MSI.

Try to add this one in the Directory table too

Directory: ProgramMenuFolder
Directory parent: TARGETDIR
Default Dir:   .:Programs


0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:wjm013
ID: 24106965
After adding the ProgramMenuFolder entry in Directory the following error appears when I validate:

ICE64: The directory newfolder1 is in the user profile but is not listed in the RemoveFile table.

I've added the RemoveFile table in Orca and see that there are 5 fields to fill out which are listed below along with descriptions from the SDK but I'm unsure what to insert in these fields:
1 - FileKey:
- Primary key used to identify this particular table entry.
2 - Component:
- External key the first column of the Component table. This field references the component that controls the file to be removed.
3 - FileName:
- This column contains the localizable name of the file to be removed. If this column is null, then the specified folder will be removed if it is empty. All of the files that match the wildcard will be removed from the specified directory.
4 - DirProperty:
- Name of a property whose value is assumed to resolve to the full path to the folder of the file to be removed. The property can be the name of a directory in the Directory table, a property set by the AppSearch table, or any other property that represents a full path.
5 - InstallMode:  
- Must be one of the following:
a - Remove only when the associated component is being installed.
b - Remove only when the associated component is being removed.
c - Remove in either of the above cases.
0
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 24107235
It is just a validation warning that I think you can ignore and proceed with installing
If not just add the below info in the RemoveFile table


1 value : any string you desire I suggest: remove1
2 value : any component that will be uninstalled at uninstall... must probably all of them will... so just add a component (From the Component table)
3 empty
4 value : newfolder1
5 value : 2
0
 

Author Comment

by:wjm013
ID: 24107530
On second though, I don't want to remove the entire directory since it will contain other user shortcuts.
0
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 24107585
You can use it, with no concerns, since the RemoveFile Table only deletes folders if they are empty.
Anyway that is just a validation error, that can be ignored.

Is the shortcut now created in the desired folder?
0
 

Author Comment

by:wjm013
ID: 24107597
I ignored the ICE64 error and did not add the RemoveFile table.

On installation I'm getting "Internal Error 2356. Instal01.cab"
0
 

Author Comment

by:wjm013
ID: 24107637
Since the installation does not complete, the shortcut is not being created.
0
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 24107727
The installation is now failing most probably because Instal01.cab is not found near your MSI file. Can't give you more info though...
Debugging with ORCA can be diffucult some times...
0
 

Author Comment

by:wjm013
ID: 24107813
My original MSI, that is the one without the "ProgramMenuFolder" and "newfolder1" entries in the Directory table and without the change in the Shortcut table from "StartMenuFolder" to "newfolder1" installs successfully.

I wonder if it's necessary to modify my VB source code to change the location of the shortcut?

Thanks for your help.



0
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 24107855
Then try to take the old MSI , that installs sucesfully, and make the same modifications over again.
Are the files that your MSI installs included in a cab that is outside... near the MSI file? Make sure that the cabs are always near the MSI file that you edit.
0
 

Author Comment

by:wjm013
ID: 24108106
My original MSI was created with the cab file compressed into the MSI so I recreated it with the cab file outside the MSI and made the changes to the Directory and Shortcut tables with Orca.

Now the installation completes without error but the shortcut still gets inserted in the old location:
                   C:\Documents and Settings\[myname]\Start Menu\Programs\Company Applications
rather than where I want it in
                  C:\Documents and Settings\All Users\Start Menu\Programs\Company Applications


0
 
LVL 3

Accepted Solution

by:
MSI_installer_expert earned 500 total points
ID: 24108513
In the Property Table add the property ALLUSERS with value: 1
0
 

Author Comment

by:wjm013
ID: 24108907
Excellent!

The shortcut is now where I want it.

Thank you.

0
 

Author Closing Comment

by:wjm013
ID: 31567799
Thanks again for your help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the major drawbacks of deploying applications by GPO is the complete lack of any centralized reporting. After a normal deployment, there are two ways to find out if it was successful – by looking in the event log, and by looking in the log of…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question