Issue with Convert Short Path and File Association

Got a problem you cannot solve? Try here.
Post Reply
Roostar2004
Posts: 155
Joined: Mon Nov 12, 2007 11:59 am

Issue with Convert Short Path and File Association

Post by Roostar2004 »

I need to associate a file to my application which I can do just fine without any problems not using short paths. It is reccomended that short paths be used so that windows does not get confused about spaces or special characters. To do this I was trying to use the following code:

Set Variable SHORT_PATH to $TARGETDIR$\bin\PROGRAM.exe
Convert to Short Path: SHORT_PATH
Create File Type Comp.PROGRAM with extensions .PRG and associate with program $SHORT_PATH$

The problem is that apply install is called after this. This means that the Convert to Short Path command is not able to get the path $TARGETDIR$\bin\PROGRAM.exe because it does not exist until the apply install. Calling 2 apply installs is not a valid option because it does not work as expected. ie. if you pin a short cut to task bar with the first apply install then it gets pined a second time with the second apply install.

if anyone has a way of doing this it would help a lot!

Matthew
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Issue with Convert Short Path and File Association

Post by mills »

InstallAware 10 would help resolve this, using the native engine, since you don't have to wait for Apply Install for the changes to take effect.

If you're using IA 9, you could consider using Call DLL function. You might need to use some combination of the following:

Directory Management Functions:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Disk Management Functions:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Otherwise, you might need to use the 2 Apply Installs, just restructure them so that before the first one, only the program file you want to create the file type for is included, then the rest of your MSI commands will appear before the second call...
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Roostar2004
Posts: 155
Joined: Mon Nov 12, 2007 11:59 am

Re: Issue with Convert Short Path and File Association

Post by Roostar2004 »

I will take a look at those functions as well as installaware 10.

Thank you.
Roostar2004
Posts: 155
Joined: Mon Nov 12, 2007 11:59 am

Re: Issue with Convert Short Path and File Association

Post by Roostar2004 »

To solve the problem I am using the following code to create the directory before the apply install command is called

Code: Select all

~InstallAware Clipboard Data~
~Convert Path~
~{0F7B4D4C-CDF0-45F0-8C98-9912A35DF637}~
~SHORT_PATH~
~TRUE~
~Set Variable~
~{7190E2C0-BA91-47B6-B3B5-009B860320A7}~
~SHORT_PATH$MYAH$MYAH$FALSE~
~$TARGETDIR$\Bin~
~Call DLL Function~
~{C83E3E2E-ABC1-4FFF-BF57-CC7103C4E69A}~
~kernel32.dll,CreateDirectory,bool,,"pointer to string",$TARGETDIR$\Bin\,$~
~mIDEFunc.dll\mEXEFunc.dll~
Post Reply