Solved

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

Posted on 2009-04-07
16
5,143 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 7 will not update 10 148
Active Directory Audit 18 116
How to install software on a provisioned vagrant image 3 75
DCOM errors in Server 2016 2 38
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…
Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 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