Quantcast
Channel: PowerShell App Deployment Toolkit
Viewing all 2341 articles
Browse latest View live

New Post: Set-RegistryTag and Remove-RegistryTag

$
0
0
Here's a pair of functions I developed recently to add a "tag" to the Windows Registry after installation. This can be used for easy application detection and version control using SCCM 2012's Application model.

Inspiration for this idea came from Jerre's Java installation script. I haven't copied any of his code, but upon reflection, they look awfully similar since they perform the same task using the same toolkit. Jerre, if you see this and you'd prefer that I take it down, let me know and I will do so.

Under the variable declaration section of the Extensions script, define a variable $regTagRoot, and set it equal to the "root" key you'd like all your tags to fall under. For example:
$regTagRoot = "HKEY_LOCAL_MACHINE\SOFTWARE\MyOrganization\Applications"
Here are the functions themselves.
function Set-RegistryTag
{
    $regKey = "$regTagRoot\$appVendor\$appName"
    Write-Log "Writing application registry tag"
    Set-RegistryKey -Key $regKey -Name "AppVersion" -Value "$appVersion" -Type String -ContinueOnError $true
    Set-RegistryKey -Key $regKey -Name "InstallDate" -Value (Get-Date) -Type String -ContinueOnError $true
    Set-RegistryKey -Key $regKey -Name "DeploymentScriptVersion" -Value "$appScriptVersion" -Type String -ContinueOnError $true
    Set-RegistryKey -Key $regKey -Name "DeploymentEngineVersion" -Value "$deployAppScriptVersion" -Type String -ContinueOnError $true
    Set-RegistryKey -Key $regKey -Name "DeploymentExtensionVersion" -Value "$appDeployExtScriptVersion" -Type String -ContinueOnError $true
}

function Remove-RegistryTag
{
    $regKeyParent = "$regTagRoot\$appVendor"
    
    if (Test-Path -Path $regKeyParent)
    {
        $regKey = "$regKeyParent\$appName"
        if (Test-Path -Path $regKey)
        {
            Write-Log "Removing application registry tag"
            Remove-RegistryKey -Key $regKey -Recurse -ContinueOnError $true
        }

        if (Get-ChildItem -Path $regKeyParent)
        {
            Write-Log "Other registry entries still exist under the parent key ('$regKeyParent')"
        } else {
            Write-Log "Parent registry key ('$regKeyParent') was detected as empty and will be removed"
            Remove-RegistryKey -Key $regKeyParent -Recurse -ContinueOnError $true
        }
    }
}

New Post: BlockExecution Function

$
0
0
What version are you using? The custom TempPath function would work on the 3.1.2 which you can get from the source section, since its not been released as a version yet.

Released: PowerShell App Deployment Toolkit v3.1.2 (May 02, 2014)

$
0
0
  • Added Get-IniValue / Set-IniValue functions. Replaces Get-IniContent / Set-IniContent which were a bit unwieldy. The new functions are much easier to use.
  • Added -Value parameter to Get-RegistryKey so that a specific registry value can be retrieved instead of the entire Key as an object
  • Fixed Test-Battery to work with machines that can have multiple batteries
  • Fixed issue where BlockExecution would fail if a Custom Temp Path was specified in the config file
  • Updated examples with latest templates and Office 2013
  • Updated French translations
  • Updated Japanese translations

Updated Release: PowerShell App Deployment Toolkit v3.1.2 (May 02, 2014)

$
0
0
  • Added Get-IniValue / Set-IniValue functions. Replaces Get-IniContent / Set-IniContent which were a bit unwieldy. The new functions are much easier to use.
  • Added -Value parameter to Get-RegistryKey so that a specific registry value can be retrieved instead of the entire Key as an object
  • Fixed Test-Battery to work with machines that can have multiple batteries
  • Fixed issue where BlockExecution would fail if a Custom Temp Path was specified in the config file
  • Updated examples with latest templates and Office 2013
  • Updated French translations
  • Updated Japanese translations

New Post: Error 1603/1722 by registering an application

$
0
0
Dear all,

I use the tool since two month and it works fine for me.

Currently I have to use the tool for a new installation. On the end I get the error code 1603, into eventvwr I saw the error 1722 on the last step of installation to register the program.exe

I tried different ways to install the application...

When I start the installation within a new script (not the tool) using "$errno=Start-Process -FilePath "Setup.exe" -Wait -Passthru).ExitCode" all works fine, no error. Also when I run the install manually with the setup.exe, no error occured.

The same command line used within the Deploy-Application.ps1 the error occured.

So it seams the problem only occure when I use the tool.

Strange...

Regards,
Maximilian

New Post: MSI Installer with commad line - Failed to install

$
0
0
Hello all,

Thanks for the awesome toolkit.

I am trying to deploy a package (FIM PasswordClient) and that requires an extra command line that runs during the install.

I would like to use the toolkit to add this command line during installation:

* INSTALLATION

$installPhase = "Installation"
# Perform installation tasks here
Execute-Process -FilePath "Add-ins and extensions.msi" -Arguments "ADDLOCAL=PasswordClient PORTAL_LOCATION=MyPortalServer PORTAL_PREFIX=https MONITORED_EMAIL=fimservice@contoso.com" -WindowStyle Hidden -IgnoreExitCodes "3010"
# Install the patch


If anyone could please shed some lights on this, as I spent so much time figuring on how to execute this successfully

Any help is appreciated.


Thanks

Reviewed: PowerShell App Deployment Toolkit v3.1.2 (Mai 03, 2014)

$
0
0
Rated 5 Stars (out of 5) - This is an amazing helpful tool! Thank you so much for your work guys!

New Post: MSI Installer with commad line - Failed to install

$
0
0
I've had issues with using multiple switches with the -Arguments function, but most of them were with using multiple switches that needed "", so if thats the case for yours, it would need to have ' at the beginning and end of the arguments. Example:
-Arguments 'ADDLOCAL="PasswordClient" PORTAL_LOCATION="MyPortalServer" PORTAL_PREFIX="https" MONITORED_EMAIL="fimservice@contoso.com"'
Not saying that is exactly how it is supposed to be layed out, but if each switch required its answer to be enclosed in "" you would need the entire arguement enclosed in ' '.

New Post: Error 1603/1722 by registering an application

$
0
0
Hi Maximilian,

Have you tried using the Execute-Process function? 1603 as an exit code would seem to imply this is actually an MSI being called by the executable. You might consider running the MSI directly using Execute-MSI which will give verbose logging of the MSI. You can look through this to find out what's causing the 1603. It might be a custom action which is failing due to something you're doing in the script.

Mind posting more details on the script itself and what you're trying to install?

Dan

Source code checked in, #6a89f32983b5666869154026ccfa8718b7bf7c4c

$
0
0
Added variable expansion to all paths in the configuration file - which fixes Temp folder location on Windows XP to use correct %PUBLIC% path

New Post: BlockExecution Function

$
0
0
I've made a commit to the source which respects variables.

<Toolkit_TempPath>C:\Users\Public</Toolkit_TempPath>

is now

<Toolkit_TempPath>$envPublic</Toolkit_TempPath>

which will use the correct Public folder.

Cheers, Dan

New Post: BlockExecution Function

New Post: Deployment Script: Oracle Java Runtime 1.7.0.51

$
0
0
Nelu_G wrote:
PowerSheller wrote:
@Nelu_G just remove the ContinueOnError switch
@Jerre, can you update the script to remove this, it's not needed
Thanks for the advice, I removed "ContinueOnError" and now its working.
I have a suggestion though: on a 64bit computer you need to install both Java versions and the installer files are different:
jre-7u51-windows-i586.exe, for 32bit
and
jre-7u51-windows-x64.exe, for 64bit.

In VBScript I use a If-Then loop where I evaluate the OS architechture and if it
s Windows 7 x86 I will call "jre-7u51-windows-i586.exe", else I would call "jre-7u51-windows-x64.exe".
I`ll try to change the script to perform just that.

I think I found a solution which works for me, at least on Windows 7 64bit:
#* INSTALLATION 
$installPhase = "Installation"
#*===============================================

    # Perform installation tasks here

    # Install Java with .exe
    
    $isShell32 = [bool]((Get-Process -Id $PID | ?{$_.path -like "*SysWOW64*"}) -or !([IntPtr]::Size -eq 8))

if ($isShell32)
{ Execute-Process -FilePath "jre-7u51-windows-i586.exe" -Arguments "/s WEB_JAVA_SECURITY_LEVEL=M /L $env:windir\Logs\Software\Java7U51Setup.log" -WindowStyle Hidden -IgnoreExitCodes "3010"}
else #x64
{ Execute-Process -FilePath "jre-7u51-windows-x64.exe" -Arguments "/s WEB_JAVA_SECURITY_LEVEL=M /L $env:windir\Logs\Software\Java7U51Setup.log" -WindowStyle Hidden -IgnoreExitCodes "3010"}
    
    


#*===============================================
Please let me know what you think,

Thanks,

Nelu
I don't understand.

You say that on 64bits computer you have to install both version, but in your script you install 32 bits java on 32 bits OS and just 64 bits java for 64 bits OS.

New Post: Deployment Script: Adobe Flash player 11.9.900.152

$
0
0
JNoxon wrote:
# Set Adobe Flash Config file to stop Auto-Updates (32-bit)
Copy-File -Path "$dirSupportFiles\mms.cfg" -Destination "$envWindir\system32\Macromed\Flash\mms.cfg"
# Set Adobe Flash Config file to stop Auto-Updates (64-bit)
Copy-File -Path "$dirSupportFiles\mms.cfg" -Destination "$envWindir\SysWOW64\Macromed\Flash\mms.cfg"

Hi,

what is the behavior of "copy-file"?
You do not need to test if the path exists before? It will not create a tree SysWOW64 on 32-bit systems?

New Post: Deployment Script: Adobe Flash player 11.9.900.152

$
0
0
another little thing

you should test OS version before the show-welcome

on W8 and superior, you will ask the user to close Internet Explorer whereas it's not necessary.

New Post: Deployment Script: Adobe Flash player 11.9.900.152

$
0
0
and last question I think :D

what detection method do you configure ? As the activex MSI isn't installed on all computer ? only detect the plugin version ?

Reviewed: PowerShell App Deployment Toolkit v3.1.2 (May 06, 2014)

$
0
0
Rated 5 Stars (out of 5) - Excellent Deployment Tool once you get used to it, it's basically all you need for app deployment.

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
is there any code we can put in under post-installation to check if there's a user currently logged on or not??

sort of like if a user is currently logged on , popup a notification and check if any opened programs need to be closed before installing softwares, else if no one is logged on now, just go ahead and proceed and install...

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
you can use a custom global condition

setting type : script
data type : boolean
script language : Windows powershell
[bool] (Get-Process explorer -ea 0)

after I create, for each application, two deployment types, using the same sources, one "silent" only when no user is logged on, with the condition = false, installation progrram visibility hidden, and one interactive, only when a user is logged on, with the condition = true, installation program visibility normal, and you select "allow users to view and interact with the program installation"

Created Unassigned: Show-InstallationWelcome -CloseApps "iexplore,firefox" -CloseAppsCountdown 1800 [62]

$
0
0
in version 3.1.1 the countdown timer just restarts when you use the X in the top right corner of the screen!
Viewing all 2341 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>