macxcool

//macxcool
macxcool

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • macxcool
    Participant
    Post count: 23

    Just dot-source it by running . .\AppDeployToolKit\AppDeployToolkitMain.ps1 in the console once you’ve opened ISE in the script folder.

  • macxcool
    Participant
    Post count: 23

    I’m just placing something like Execute-Process -Path 'C:\temp\something.exe' in the Installation section of the script. It’s not very important except that I’m forcing an error to occur, something.exe doesn’t exist.
    Then I put some code in the Catch at the end of the script thinking that it would execute when the function failed.

  • macxcool
    Participant
    Post count: 23

    All I’m doing (I’m sorry, the vhdx was a bit of a red herring) is using Execute-Process with a non-existent executable to trigger the fail. Then I want to insert some code that runs when the fail happens.
    I’d be happy if Write-Host 'Something bad just happened' ran 😉 I can fill in the rest later.

    • This reply was modified 1 year, 5 months ago by  macxcool.
  • macxcool
    Participant
    Post count: 23

    That’s a start. Thanks.
    If that works I’ve just got to figure out how to write a propery/value into a key with a forward slash in the name.

  • macxcool
    Participant
    Post count: 23

    I’m having problems with the key name, not the value of a property. I’ve created a bug report on the tracker for it that has more detail about what I’ve tried.
    I can’t seem to create a key with forward slashes in it or write to an existing key with the same. Values seem to work out fine.

  • macxcool
    Participant
    Post count: 23

    In the above post I did put backquotes in front of the forward slashes.

  • macxcool
    Participant
    Post count: 23

    Did you try it? It doesn’t work for me. I try

    Set-RegistryKey -Key “HKCU:\TEMPORARY’c:/temp/”

    and powershell still just interprets them as backslashes and gives me:
    HKCU \ TEMPORARY \ C: \ temp
    and
    HKCU \ TEMPORARY \ C: \ emp (for some reason)

  • macxcool
    Participant
    Post count: 23

    I apologize for the mess. I have no idea how to put in code nicely.

  • macxcool
    Participant
    Post count: 23

    This doesn’t work. Here’s my code:
    [scriptblock]$HKCURegistrySettings = {
    Set-RegistryKey -Key "HKCU\Software\SoftPlan Systems Inc.\SoftPlan Workstation\16.3.4\C:$([char]0x2F)Program Files$([char]0x2F)SoftPlan2014\SoftPlan Folders\" -Name 'Projects' -Value "S:$([char]0x2F)" -SID $UserProfile.SID
    }
    Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings

    This creates a series of keys named C: \ Program Files \ SoftPlan2014 \ SoftPlan Folders \ and then refuses to create the S:\ value because the Path doesn’t exist:

    [03-18-2016 09:06:22.428] [Post-Installation] [Set-RegistryKey] :: Failed to set value [S:/] for registry key [Registry::HKEY_CURRENT_USER\
    Software\SoftPlan Systems Inc.\SoftPlan Workstation\16.3.4\C:/Program Files/SoftPlan2014\SoftPlan Folders\] [Projects].
    Error Record:
    -------------

    Message : Cannot find path 'HKEY_CURRENT_USER\Software\SoftPlan Systems Inc.\SoftPlan Workstation\16.3.4\C:/Program
    Files/SoftPlan2014\SoftPlan Folders\' because it does not exist.
    InnerException :

    FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand
    ScriptStackTrace : at Set-RegistryKey<Process>, \\5000m45\packagesource$\Software_8\Softplan_Educational_Workstation_2014\AppDeployTo
    olkit\AppDeployToolkitMain.ps1: line 3737
    at <ScriptBlock>, <No file>: line 1

    PositionMessage : At \\5000m45\packagesource$\Software_8\Softplan_Educational_Workstation_2014\AppDeployToolkit\AppDeployToolkitMain.ps1:3
    737 char:14
    + $null = New-ItemProperty -LiteralPath $key -Name $name -Value $value -Prope ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    • This reply was modified 1 year, 10 months ago by  macxcool.
  • macxcool
    Participant
    Post count: 23

    The program is the Netsupport School Tutor software (classroom management software, server part).

    We migrated from a vbs script-based installation to the PS App Deploy. TK and found that, if the installation did not run as System, the User, when running the software for the first time, could not complete the online authorization. A shield appeared on the OK button of the authorization dialog and the program complained that it needed an administrator to authorize.

    The vbs installer never had this problem, and now I realize that the PS installer is OK too when SCCM runs it as system. When installed via the SCCM Catalogue though, the problem remains. I know this is a strange one, but there it is 😉 I tried using psexec to force the exe to run as System, but this makes no difference when installed via the SCCM Catalogue.

    There is one other wrinkle that might be relevant. The people who manage Group Policy decided a while ago to completely disable User Access Control in Windows 8.1. This seems like a very bad idea, but I have zero control over GPOs. I assume that UAC would allow on-the-fly privilege escalation for purposes such as this, but that road is blocked.

  • macxcool
    Participant
    Post count: 23

    Thank you very much. Now I actually understand what I was looking for. It works fine now, and I don’t have to mess with the main script file. Bonus.

  • macxcool
    Participant
    Post count: 23

    I haven’t had any other responses yet. I’ve discovered that I can use SCCM to force the script to run as SYSTEM, but it doesn’t work when using the catalogue, even if I try to force it using psexec.

  • macxcool
    Participant
    Post count: 23

    We’re using an older version of the Toolkit in production right now. We’ll be moving to the latest version this summer. I made the modification myself to the Set-Activesetup function we have in our Extensions file. REG_SZ works fine REG_EXPAND_SZ gets ignored.

  • macxcool
    Participant
    Post count: 23

    I’m not sure how to get everything after the ‘newline’ in line 118 to stay in the ‘code’ section.

  • macxcool
    Participant
    Post count: 23

    I’m not trying to test anything with the vhd, I’m just trying to get some code to run if the script crashes for some reason. I can figure out what to do with the vhd etc.
    I think -ErrorAction ‘Stop’ is the default for the Deploy-Application.ps1 script anyway. It does error out when something catestrophic happens.
    How do I add code to run when the script exits suddenly?

Viewing 15 posts - 1 through 15 (of 15 total)