DOS/Windows installer 3.x

new topic     » topic index » view thread      » older message » newer message

Suggestions for improvement of the DOS/Windows installer:

a) It should make a copy of "autoexec.bat" before changing that file.

b) It should assign _short_ path names to the environment variables in
   "autoexec.bat".
   I know, on an English Windows version Euphoria will be installed by
   default to the directory "C:\Programs\Euphoria". Since no part of
   this path has more than 8 characters, there will be no problem.
   But people might chose a diffwerent location, or for instance in
   German it is "Programme" instead of "Programs".

   So the installer should write to a German "autoexec.bat" e.g.
      SET EUDIR=C:\Progra~1\Euphoria
   instead of
      SET EUDIR=C:\Programme\Euphoria
   This is important, because plain DOS can only process short names.

   The following Windows function converts an existing long path name to
   a short name:
  
include machine.e
   include dll.e

   constant
      Kernel32 = open_dll("kernel32.dll"),
      GetShortPathName = define_c_func(Kernel32, "GetShortPathNameA",
                         {C_POINTER, C_POINTER, C_ULONG}, C_ULONG)

   global function short_pathname (sequence longName)
      sequence ret
      atom lpszLongName, lpszShortName
      integer bufferSize, shortLength

      ret = longName
      bufferSize = 1000
      lpszLongName = allocate_string(longName)
      lpszShortName = allocate(bufferSize)

      if lpszLongName and lpszShortName then
shortLength = c_func(GetShortPathName, {lpszLongName, lpszShortName,
         bufferSize})
         if shortLength >= bufferSize then
            free(lpszShortName)
            bufferSize = shortLength + 1
            shortLength = 0
            lpszShortName = allocate(bufferSize)
            if lpszShortName then
shortLength = c_func(GetShortPathName, {lpszLongName,
               lpszShortName, bufferSize})
            end if
         end if
         if shortLength then
            ret = peek({lpszShortName, shortLength})
         end if
         free(lpszShortName)
      end if

      return ret
   end function

   -- Demo
   sequence longName
   longName = "C:\\Programme\\Sprachen\\Euphoria"
   puts(1, short_pathname(longName))
   


   Maybe a program that uses a function like this can help.

Rob, if you want, you can also send me the setup script
(I assume you are using INNO setup), and I'll see what I can do.

Regards,
   Juergen

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu