No announcement yet.

Copy File In MSI Using LuaScript

  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy File In MSI Using LuaScript

    Is it possible using LuaScript, to copy a file that is included in my project, prior to anything being installed yet? I need to access a DLL that is also included with my application's installation, but I need to copy it to the Windows 'Temp' folder and then access it from there first. It will be used to validate serial numbers prior to any application files being installed to the application's final target folders. The file will deleted after it is used.

  • #2
    This is possible, and you need to use the bootstrapper for this.



    • #3
      Can you post an example that shows how to do it? Or post a link for an example? Thanks.


      • #4
        I currently do not have a code sample for your specific request. I do have sample which does something very similar. The zip archive attached contains a bootstrapper template for bundling and processing other MSI packages before your own MSI is shown on the screen. You can modify this script in such a manner that, instead of processing additional MSI packages, one or more files you need is/are decompressed and placed where you need it/them before opening the MSI defined as mainsetup.

        To use this, decompress the contents of the attached zip file into MSI Factory\Bootstrap\Templates. Create a new bootstrapper using the "Extract and Run Multiple MSI Files" option which should now appear:

        Click image for larger version

Name:	SCRN-2018-05-16-01.png
Views:	390
Size:	3.7 KB
ID:	300182

        Open the mainscript, and make the changes to the file. You will find the relevant custom code from lines 123 to 139. Of course there is also a new custom function defined at the script start which is needed, but you need to make changes only where I mentioned, leaving the whole rest as it is. Define the support file (the DLL) as the only element in tInstallOrder, and this will work exactly as you need it.

        Should you have difficulties making this work, you can contact me.



        • #5
          Thanks very much Ulrich. I will try it out. I appreciate the help on this.