aekalman
10th May 2005 00:35 UTC
$EXEDIR Not Working?
Hi All.
I have:
Section Uninstall
IfFileExists "$EXEDIR\silly.txt" SillyTxtFound
MessageBox MB_OK|MB_ICONSTOP "Silly.txt not found!$\r$\n \
Uninstallation cannot proceed!"
Abort
SillyTxtFound:
Yet when I run the uninstaller in either Win98 or Win2k, I always get the error message that Silly.txt cannot be found.
Silly.txt and the uninstaller.exe are in the same directory.
What am I doing wrong?
Thanks,
--Andrew
aekalman
10th May 2005 00:40 UTC
BTW, if I
Messagebox MB_OK "Exedir is $EXEDIR"
I get
"Exedir is C:\WINDOWS\TEMP"
(Win98, similar in Win2k)
--Andrew
aekalman
10th May 2005 00:48 UTC
OK, I see that in this thread http://forums.winamp.com/showthread....hreadid=205586,
the uninstaller copies itself to the temp dir, execs the exe in temp and exits (so it can delete itself). u can manually copy the uninst.exe to temp then exec it with a special command line argument ( "uninst.exe _?=$instdir" if i remember correctly)
I understand why that is useful. Couldn't find a mention of that in the help file, though.
But how do I get the uninstaller to automatically read a file that is located in the same directory as the uninstaller .exe?
--Thanks,
Andrew
scully13
10th May 2005 14:03 UTC
I have a situation where I do a similar thing. In my instance the file I want to read is in the same folder as my uninstaller which is also the install directory. So, instead of $EXEDIR I use $INSTDIR.
Joost Verburg
10th May 2005 14:15 UTC
$INSTDIR is the location of the original uninstaller.
aekalman
10th May 2005 21:47 UTC
But isn't $INSTDIR a compile-time setting?
Namely, if $INSTDIR is initialized to C:\MyDir in the script but the user installs to d:\OtherDir instead, then $INSTDIR still points to C:\MyDir, right?
--Andrew
Afrow UK
10th May 2005 22:06 UTC
$INSTDIR is a dynamic variable, not a constant. It changes to whatever value was put on the directory page.
You can set the value of $INSTDIR with any assignment commands such as ReadRegStr or StrCpy.
-Stu