locked
How do I insert a file into a package upon launch AppV 5 RRS feed

  • Question

  • Hello everyone, I have a number of different clients that use the same version of QuickBooks. However, resequencing the same application and storing in the content store is not realistic. I would like to take an existing sequenced package, and have it execute a script that will pull the license from a shared location based at their site. I am not sure how to write the script or where to put it.

    Here is the path where the file is located.

    C\ProgramData\Common Files\Intuit\QuickBooks

    Thank you for your help

    Paul 

     

    Duramaxster

    Thursday, May 22, 2014 5:06 PM

Answers

  • Hello,

    See this post on howto leverage a process start script;

    http://myitforum.com/myitforumwp/2014/02/15/app-v-5-0-demo-user-scripting-startprocess/

    Just replace the .exe with your script of choice


    Nicke Källén | The Knack| Twitter: @Znackattack

    • Marked as answer by Duramaxster Wednesday, June 4, 2014 3:23 PM
    Thursday, May 22, 2014 5:08 PM
  • Hello,

    If you are using the StartProcess trigger the ApplicationID must be supplied as it states WHAT process will be used as the trigger to fire your script. The ApplicationID should match the ApplicationID of the file you want to trigger off - this can also be found in the XML-file

    If you place the script in the Scripts-folder of the package the full-path is usually not required. Any other path you would need to provide the script.

    The scripts folder is location which you can use to place the script in, but it is not technically required by any means. 

    As with anything new;

    1. Validate that your script does what you want it todo before attempting to use it for anything in production, or even attempting to use it in your package. 

    2. Validate that the trigger is the correct trigger you want to use.

    4. Validate that they work together, and think what happens if something doesn't work. What if... goes wrong, what happens then?


    Nicke Källén | The Knack| Twitter: @Znackattack

    • Marked as answer by Duramaxster Wednesday, June 4, 2014 3:23 PM
    Sunday, May 25, 2014 7:01 PM

All replies

  • Hello,

    See this post on howto leverage a process start script;

    http://myitforum.com/myitforumwp/2014/02/15/app-v-5-0-demo-user-scripting-startprocess/

    Just replace the .exe with your script of choice


    Nicke Källén | The Knack| Twitter: @Znackattack

    • Marked as answer by Duramaxster Wednesday, June 4, 2014 3:23 PM
    Thursday, May 22, 2014 5:08 PM
  • Knack, okay, so I create a PS script to insert a file? What is the file path to the path I described above to use in my powershell script? How should it look?

    Does this look right for the Powershell command (Saving as QBLicense.ps1)? I am just learning PS. See inBOLD.

    Do I have to add the .PS1 file to the Scripts folder in the Package before saving? I am assuming yes...

    function Get-ScriptDirectory{ 
    
      $Invocation = (Get-Variable MyInvocation -Scope 1).Value
      Split-Path $Invocation.MyCommand.Path
    }
     
    $vfsPath = Join-Path (Get-ScriptDirectory) ""
    write-host$vfsPath
    
    $LICSource = \\Server.local\license\QBLicense.dat
    
    Set-Location $vfsPath\Common AppData\COMMON FILES\INTUIT\QUICKBOOKS
       copy-item -path $LICSource -destination $vfsPath 


    And do I keep this Userscript as is? 

    <UserScripts>
       <StartProcess RunInVirtualEnvironment="false">
          <Path>powershell.exe</Path>
          <Arguments>-ExecutionPolicy Bypass -File "[{AppVPackageRoot}]\..\Scripts\QBLicense.ps1"</Arguments>
          <Wait RollbackOnError="true"/>
     IS THIS NEEDED --->     <ApplicationId>[{AppVPackageRoot}]\Sudoku.exe</ApplicationId>
       </StartProcess>
    </UserScripts>


    One more thing, will this run first before the application actually runs, or should I place this in the MachineDeployment script?

    Thank you!
    Paul


    Duramaxster

    Thursday, May 22, 2014 6:47 PM
  • Hello,

    If you are using the StartProcess trigger the ApplicationID must be supplied as it states WHAT process will be used as the trigger to fire your script. The ApplicationID should match the ApplicationID of the file you want to trigger off - this can also be found in the XML-file

    If you place the script in the Scripts-folder of the package the full-path is usually not required. Any other path you would need to provide the script.

    The scripts folder is location which you can use to place the script in, but it is not technically required by any means. 

    As with anything new;

    1. Validate that your script does what you want it todo before attempting to use it for anything in production, or even attempting to use it in your package. 

    2. Validate that the trigger is the correct trigger you want to use.

    4. Validate that they work together, and think what happens if something doesn't work. What if... goes wrong, what happens then?


    Nicke Källén | The Knack| Twitter: @Znackattack

    • Marked as answer by Duramaxster Wednesday, June 4, 2014 3:23 PM
    Sunday, May 25, 2014 7:01 PM