Page 1 of 1
Convert Path not working?
Posted: Fri Nov 02, 2007 10:28 am
by Phil
I have recently tried to take one of our old programs and move it from Install Sheild to Install Aware. We write in an .ini to tell the program the location of some sound files. The program want's to have the short paths like Progra~1/Compa~1. When I don't try to change the path it shows up fine like C:\\Program Files\\Company but when I switch it to go to short, it points to some location in the user directory like C:\\users\\myna~1\\..\\..\\..\\gr342.tmp\\program.exe. I am building this as a single self-installing exe.
Posted: Fri Nov 02, 2007 3:01 pm
by Alex_Ronquillo
Phil,
Please post a little simple project showing this behavior, so we can check it.
Posted: Tue Nov 06, 2007 9:27 am
by Phil
Okay, here is the project in a zip file. The installer writes to an ini file with the locations that it is getting.
File Attached:
My Project.zip
Posted: Mon Nov 12, 2007 2:46 pm
by Mateo
Is there a fix for this? I'm having the same problem with some legacy software as well and really need to be able to convert to a short path.
Thanks
Posted: Tue Nov 27, 2007 8:50 am
by Phil
Bump.
Never got a response to this after I posted a test project.
Posted: Tue Nov 27, 2007 1:37 pm
by Alex_Ronquillo
Sorry for the delay on this. Here are my findings:
You are trying to mess with variable TARGETDIR, and that confuses IA. Change the following code:
Code: Select all
Convert to Short Path: TARGETDIR
Edit INI File $TARGETDIR$\\test.ini, [TEST] TEST=$TARGETDIR$\\test
Convert to Long Path: TARGETDIR
Edit INI File $TARGETDIR$\\test.ini, [TEST] TEST=$TARGETDIR$\\test\\test.dat
for:
Code: Select all
Set Variable tempVar to $TARGETDIR$
Convert to Short Path: tempVar
Edit INI File $TARGETDIR$\\test.ini, [TEST] TEST=$tempVar$\\test
Convert to Long Path: tempVar
Edit INI File $TARGETDIR$\\test.ini, [TEST2] TEST=$tempVar$\\test\\test.dat
You'll see it works.
Posted: Tue Dec 04, 2007 9:39 am
by Phil
Sorry to not get back sooner, but I just had a chance to test this out, and here is what I got. I entered what you had:
Code: Select all
Set Variable tempVar to $TARGETDIR$
Convert to Short Path: tempVar
Edit INI File $TARGETDIR$\\test.ini, [TEST] TEST=$tempVar$\\test
Convert to Long Path: tempVar
Edit INI File $TARGETDIR$\\test.ini, [TEST2] TEST=$tempVar$\\test\\test.dat
and this is the output from the change in code:
[TEST]
TEST=C:\\DOCUME~1\\DEVELO~1\\LOCALS~1\\Temp\\mia17.tmp\\My Project.exe\\test
[TEST2]
TEST=C:\\Documents and Settings\\development\\Local Settings\\Temp\\mia17.tmp\\My Project.exe\\test\\test.dat
The output is still pointing to a .tmp and an .exe... not what I am looking for. It should be pointing to c:\\Program Files\\My Project\\test. So the output should be c:\\Progra~\\MyProg~\\test shouldn't it?
Posted: Tue Dec 04, 2007 12:47 pm
by Alex_Ronquillo
Phil,
I tried it and it worked for me. What version of IA you have? In what OS are you testing this? Let me know.
Posted: Tue Dec 04, 2007 1:33 pm
by Phil
IA: 7.0(Build lonepine_rtm.071107)
Testing OS: XP Service Pack 2