/build/static/layout/Breadcrumb_cap_w.png

SHORTFILENAMES-property useful for "converting" INSTALLDIR?

Hi everyone,

I'm currently repackaging an application that requires "short" pathnames in some of its ini-files. It's a requirement to have this work on different language OS versions and thus hardcoding these paths is not doable.

I've tried using the SHORTFILENAMES-property to set a short filename variant of INSTALLDIR .. like this:


  • In a non-deffered CA, sat SHORTFILENAMES=TRUE
  • Another CA setting INSTALLDIRSHORT to the value of INSTALLDIR
  • Last CA reverting SHORTFILENAMES back to false.


This isn't working, the value of INSTALLDIRSHORT after the last CA is in the long format. Probably I'm missing something or I don't understand how this is supposed to work. Is there any way of easily populating a property with the short filename of INSTALLDIR?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: AngelD 17 years ago
Red Belt
0
Have you tried using [!PrimaryKeyForFileInFileTable]?

From the SDK:
If a substring of the form [!filekey] is found, it is replaced by the full short path of the file, with the value filekey used as a key into the File table.
Posted by: deploy.no 17 years ago
Orange Belt
0
Yeah, I looked up that one, trouble was, I needed the directory path, not the full file path. But I could probably just create a dummy entry in the File table that never gets installed, and reference that. The dummy file would then need to have the same short pathname as the directory that WILL be installed. Should work.

Thanks for getting me to rethink that.

Right now I solve this by conditionally installing different INI-entries based on the reported language. Works but doesn't scale to unknown languages :-)
Posted by: AngelD 17 years ago
Red Belt
0
You could always author a custom action that reads in the file path and then parse out the file part which you then set another property to hold.

Something like this:
Dim FilePath, Directory
FilePath = MsiGetFilePath("MyFile.txt")
Directory = Mid(FilePath, 1, InStrRev(FilePath, "\")) '// end with a trailing \
'// Directory = Mid(FilePath, 1, InStrRev(FilePath, "\")-1) '// does not end with a trailing \
Session.Property("MyProperty") = Directory

Function MsiGetFilePath(File)
Dim Database, Record, View, FileRecord

Set Database = Session.Database
Set Record = Session.Installer.CreateRecord(0)

Set View = Database.OpenView("SELECT * FROM `File` WHERE `File` = '" & File & "'")
View.Execute

Set FileRecord = View.Fetch
If (FileRecord Is Nothing) Then
MsiGetFilePath = ""
Exit Function
End If

Record.StringData(0) = "[!" & FileRecord.StringData(1) & "]"
MsiGetFilePath = Session.FormatRecord(Record)
End Function
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ