Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

Shortcut target name space getting Replaced by _

Created: 08 Dec 2011 | 5 comments
Treasa01's picture
0 0 Votes
Login to vote

I am creating an mst.The shortcut target location should point to W:\Log\New Log Guide.pdf.The installtion is successful.But when i check the shorcut properties,It's shown as W:\Log\New_Log_Guide.pdf.The space between New Log Guide is replaced by New_Log_Guide.I tried everything possible.Quotes,Properties,Scripts..No luck.Please help me out

Discussion Filed Under:

Comments

EdT's picture
08
Dec
2011
1 Vote +1
Login to vote

Try using the shortfilename

Try using the shortfilename version of the filename:  NEWLOG~1.PDF

One other thing you should bear in mind is that the API call which creates the shortcut needs access to the file referenced as target at the time the shortcut is created. Since a W: drive is referenced, if your app is deployed by any service based installer, the W: drive will not be visible and you will have problems with shortcut creation.

There are two solutions:

1. Instead of creating a shortcut, copy the .LNK shortcut file to the appropriate location. As this is a simple file copy operation, the shortcut contents will be unchanged to those you set during testing.

2. Install a launcher file to the local machine - eg a batch file or a wisescript EXE (the latter is easier to run silently). Have this launcher check for the existence of the file and then launch it if found. This way your shortcut points to the local file so creation is no issue, and the launcher guarantees a clean recovery if the W: mapping is not present or the file is missing on W:

One final thing - PDF files are regarded as a security risk as they can carry a payload. Running a PDF file from a network location can be treated as a security risk by many antivirus programs so you need to test this will not be an issue in your environment.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

VBScab's picture
08
Dec
2011
0 Votes 0
Login to vote

Correct me if I'm wrong, Ed...

...but isn't the standard dodge for this to use a property? That is, create a property containing the path as its value and then use that property to populate the shortcut fields?

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

piyushnasa's picture
08
Dec
2011
0 Votes 0
Login to vote

I think it is the problem

I think it is the problem with the naming of the shortcut. You have to give a shortfile name for shortcut as well, not just the keypath of shortcut and then Pipe it to the full name of the shortcut. It should look like below:

Shortcut Column: Newlog (It can be any unique name)

Directory Column: ProgramMenuFolder (Or where you want to place it)

Name Column: NEWLOG~1.PDF|New Log Guide.pdf\

Component: <Your Component Name>

Target: W:\Log\New Log Guide.pdf

 

I think this should do the trick for you to make it work fine. I have done a lot of shortcut apps like this. Let me know if you face any issues.

Piyush Nasa Altiris Certified Professional (ACP)

http://msiworld.blogspot.com/

EdT's picture
08
Dec
2011
0 Votes 0
Login to vote

I don't see how using a

I don't see how using a property is any different to hard coding the value, as the property has to have a value at install time, and if the value is invalid when the shortcut is created, then you are going to have problems.

However, you may have a point where advertised shortcuts are involved as the shortcut links into the locally cached MSI so that key path checking can take place when the app is launched.

However, you cannot create an advertised shortcut to a file which is not installed by the MSI, and I'm assuming that a file on the W: drive is unlikely to have been installed by the MSI in question, so we are talking about a non-advertised shortcut. If I recall correctly, the API which creates a non-advertised shortcut interrogates the target file so that it can extract the icon information and check that the file is there. As a test, try creating a shortcut to a non-existent file and see what happens.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

piyushnasa's picture
21
Dec
2011
0 Votes 0
Login to vote

Is your issue solved?

If your issue is solved do let everyone know by marking a solution or by letting everyone know what you did to get this solved. It helps everyone..

Piyush Nasa Altiris Certified Professional (ACP)

http://msiworld.blogspot.com/