VersalEszett
Posts: 6
Joined: Mon Jan 29, 2018 5:17 pm

PseudoFormatted Properties

Hi,

I'm searching for PseudoFormatted types/modifiers that hold the following properties:
  • The application folder source directory
  • The package name set via advancedinstaller.com /SetPackageName
  • The [major].[minor] version number (only the first two tokens)
  • The build date & time
  • The output file for the intermediate MSI file when creating a "Single EXE setup" similar to [|AI_BUILD_OUTPUT_FILE] in a post-build event, but in the "before EXE packing" step
Are any of these available or are there workarounds to access these values?

Thanks!
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: PseudoFormatted Properties

Hi and welcome to our forums,

First of all, let's clarify what PseudoFormatted means.

The Advanced Installer PseudoFormatted data type is a string which can contain references to Properties. At build time the property references are replaced with the value of the respective properties. References embedded in a PseudoFormatted string must respect the following syntax:
  • [|propertyname]
Properties referenced by PseudoFormatted data types are resolved at build time while properties referenced by Formatted data types are resolved at runtime.

Also, you can press the F1 keyboard's shortcut to open the context help and see if the related field is of PseudoFormatted Type or it is of Formatted Type.

What I assume you are asking for is the properties that give you the values mentioned above?

1) Source folder directory. Here I assume you are referring to the folder(s) from where Advanced Installer reads the files it will include inside your installer. This path is not stored in a property, Advanced Installer simply reads the source for each file from the project you configured, at build time.

You can control/switch these source locations by leveraging our path variables support.

If you are looking for the default install path, than APPDIR is the property you're looking for. This property is set at install time by the MSI, based on information it reads from that machine.

2) Here is a more detailed answer.

A short answer/solution is to save your MSI/EXE name in a new public property in Install Parameters page, then go to Builds page and refer those properties in the "MSI/EXE Name" fields, leveraging our pseudoformatted support. This way you can re-use those property anyway you want to. (Beware if you're using them at install time, as your users might rename the setup package, the more detailed answer linked above cand help in this case)

3) The ProductVersion property has this information, you just need to ignore/trim the rest of the values from it. There is no property that can offer you just those two values.

4) This info is not stored in the MSI database, but you can read it from the file's properties, just as you can do with any file from your OS.

5) You have two options to access this MSI:
a) configure a post-build event that extracts it, using our EXE command line switches
b) duplicate the build that creates your EXE and configure it to create an MSI as output

If you can give us details on how you want to use this info maybe we could provide a solution more suitable/simple.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
VersalEszett
Posts: 6
Joined: Mon Jan 29, 2018 5:17 pm

Re: PseudoFormatted Properties

Hi, thanks for your answer. I was explicitly mentioning PseudoFormatted properties, because I need those properties at build time.

Just to explain what I want to do: I want to create a unique package name in the AI Jenkins plugin that contains information like the build ID, the major/minor version, the build date and some more properties from the Jenkins built. I then need to manually sign the intermediate MSI and final EXE using pre/post build steps that run an external tool (which is unfortunately mandated by corporate policy). For this, I need the file names at each step.
  1. I'm already using Path Variables, but they do not work in pre/post build steps in the current AI version. That's why I looked for an alternative.
  2. We are using AI Jenkins plugin to set a unique package name when run from our CI. But I guess I could also change a custom property that can than used instead of the package name at several places.
  3. How can I trim the rest? I looked for string manipulation within AI, but didn't find anything.
  4. I guess the Date and Time Properties should be sufficient to be used at build time.
  5. Here, I meant only the output file name. I also need this at build time, but it seems like the custom property from 1) can be used as workaround.
Thanks for your help! Would it be possible for you to add a property for 5) in AI? Or maybe change the value of AI_BUILD_OUTPUT_FILE to the intermediate file while running in the "Execute this before EXE packing" custom build step?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: PseudoFormatted Properties

Hello,

1. I'm afraid we do not have any dedicated property storing the path of the app files source location. However, if you need to access them only to sign them with your own tool, then here is what you can try:

a. check the "Enable signing" option from "Digital Signature" page and make sure you add in "Files Configured for Signing" section all the files you want to be signed; at build time Advanced Installer will call the SignTool.exe system tool to sign those files; each file path will be sent as an parameter to the SignTool.exe call

b. create a small app (named SignTool.exe and which should have a 6.2 or greater file version) which when called parses the received parameters, extracts the filenames and further calls your custom signing tool to sign the files

c. open Advanced Installer, go to "File menu -> Settings -> External Tools" and set the path to your custom "Signtool.exe" in the "SignTool.exe" field

2. Yes, this should work. You should just set the pseudo-formatted reference of the related property in all projects fields you want to use a build specific value. Then you should just use a pre-build event which sets the related property to a build specific value.

3. For this you will have to write your own app which will parse and extract the product version fields as you need and set them into other installer properties; the app when called should receive as a parameter the [|ProductVersion] reference and must be called using a pre-build event; the it should parse the value and save the versions into separate properties using our /SetProperty command

4. No, this won't work. The related properties are resolved only by Windows Installer at install time. For this you will have to write your own app too which will store the date and time to installer properties as explained above and run this app as a pre-build event.

5. Unfortunately this cannot be achieved.
Thanks for your help! Would it be possible for you to add a property for 5) in AI? Or maybe change the value of AI_BUILD_OUTPUT_FILE to the intermediate file while running in the "Execute this before EXE packing" custom build step?
Currently this is not possible. I've forwarded your request to our dev team and if such property/option will be available in the future we will notify you. However, to be honest I have to say there are few chances this improvement to be available in the future. Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”