Giter Club home page Giter Club logo

Comments (10)

GruberMarkus avatar GruberMarkus commented on May 29, 2024

For further analysis, post the complete output of the script running in verbose mode ('-Verbose' parameter), as well as your ini file.

from set-outlooksignatures.

dakolta avatar dakolta commented on May 29, 2024

This is my folder:
image

This is thew INI file:
image

This is the output of the script:
script-output.txt

from set-outlooksignatures.

GruberMarkus avatar GruberMarkus commented on May 29, 2024

You set SignatureTemplatePath to '.\templates\Main', but leave SignatureIniPath at the default value of '.\templates\Signatures DOCX_Signatures.ini'. Set SignatureIniPath to '.\templates\Main_Signatures.ini'.

With your settings, the default ini file is used, which only contains references to DOCX templates. This means, the script can't find any matches between the (.htm) files stored in SignatureTemplatePath and the (.docx) files referenced in SignatureIniPath. This, in turn, leads to the error you reported. I wrote a fix in v3.2.1-beta2, which works fine when emulation your situation in my test environment. Please test this version and let me know the result.



You seem to change parameters directly in the script file, instead of passing them as script parameters (such as you did with the '-verbose' parameter). This is totally fine from a technical point of view, but makes version changes harder for you and support harder for both of us. I strongly recommend passing parameters to Set-OutlookSignatures instead of altering them directly in the script file.



Do you have Outlook installed on your test machine? What Outlook version are you using? Either there is a mismatch between registry and the file system, or something is wrong in the version detection. Send me the output of this PowerShell script for verification:

try {
    $OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\WOW6432NODE\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction SilentlyContinue).'(default)')\LocalServer32" -ErrorAction SilentlyContinue).'(default)').versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
} catch {
    try {
        $OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction SilentlyContinue).'(default)')\LocalServer32" -ErrorAction SilentlyContinue).'(default)').versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
    } catch {
        $OutlookFileVersion = $null
    }
}
$OutlookRegistryVersion = [System.Version]::Parse(((((((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CurVer' -ErrorAction SilentlyContinue).'(default)' -ireplace 'Outlook.Application.', '') + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))

write-host "Outlook file version: $($OutlookFileVersion)"
write-host "Outlook registry version: $($OutlookRegistryVersion)" 

from set-outlooksignatures.

dakolta avatar dakolta commented on May 29, 2024

Here is the output from the ps script to get the Outlook version:
PS C:\Users\bhagler> C:\Users\bhagler\Documents\Untitled1.ps1
Outlook file version: 0.0.0.0
Outlook registry version: 16.0.0.0

But I have a new error:
Get all signature template files and categorize them @2022-07-27T08:43:08-07:00@

Unexpected error. Exit.
Cannot index into a null array.
At C:\Users\bhagler\Desktop\Set-OutlookSignatures_v3.2.1-beta2\Set-OutlookSignatures.ps1:1215 char:28

  • ... switch ((@($TemplateIniSettings[($TemplateIniSettings.GetEnumerator( ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

script-output.txt

from set-outlooksignatures.

GruberMarkus avatar GruberMarkus commented on May 29, 2024

That error is a real head-scratcher. It has to do with the way PowerShell treats arrays containing only one element in certain cases.

Rund this development version and post the verbose script output: Set-OutlookSignatures.ps1.txt





Your Outlook installation is very interesting. Whats the registry value of "HKEY_CLASSES_ROOT\Outlook.Application\CLSID(Default)"?

from set-outlooksignatures.

dakolta avatar dakolta commented on May 29, 2024

Here is the output from the script you gave me:
script-output.txt
Here are the Registry entries for Outlook:
[HKEY_CLASSES_ROOT\Outlook.Application]
@="Microsoft Outlook Application"

[HKEY_CLASSES_ROOT\Outlook.Application\CLSID]
@="{0006F03A-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\Outlook.Application\CurVer]
@="Outlook.Application.16"

And:
[HKEY_CLASSES_ROOT\Outlook.Application.16]
@="Microsoft Outlook 16.0 Object Library"

[HKEY_CLASSES_ROOT\Outlook.Application.16\CLSID]
@="{0006F03A-0000-0000-C000-000000000046}"

from set-outlooksignatures.

dakolta avatar dakolta commented on May 29, 2024

Ok, I cleared out the credentials and started with a fresh download of v3.2.1-beta1, replaced thSet-OutlookSignatures.ps1 file with the Beta2 and made the change of the template folder and ini folder put in my replacement values (I understand that is not the way to do it, will fix that later).
I ran the script and everything worked, I am giving you a verbose output file:
script-output.txt

from set-outlooksignatures.

GruberMarkus avatar GruberMarkus commented on May 29, 2024

Good. Now let's find out what's going on with the detectin of the Outlook file version.

It could be a problem of the Office installation (registry, file system), or a problem in the script. The following PowerShell code will bring us near the reason:

write-host "Get Outlook file version"

try {
    write-host "  CLSID: $((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID').'(default)')"
    write-host "  WOW6432NODE"
    $OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\WOW6432NODE\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction Stop).'(default)')\LocalServer32" -ErrorAction Stop).'(default)' -ErrorAction Stop).versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
} catch {
    write-host "    failed: $_"
    try {
        write-host "  Regular node"
        $OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction Stop).'(default)')\LocalServer32" -ErrorAction Stop).'(default)' -ErrorAction Stop).versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
    } catch {
        write-host "    Failed: $_"
        $OutlookFileVersion = $null
    }
}

write-host "  $($OutlookFileVersion)"

from set-outlooksignatures.

dakolta avatar dakolta commented on May 29, 2024

The version of Outlook I am using is from Office365:

CLSID: {0006F03A-0000-0000-C000-000000000046}
WOW6432NODE
failed: Cannot find path 'HKEY_CLASSES_ROOT\WOW6432NODE\CLSID{0006F03A-0000-0000-C000-000000000046}\LocalServer32' because it does not exist.
Regular node
16.0.15330.20264

from set-outlooksignatures.

GruberMarkus avatar GruberMarkus commented on May 29, 2024

Set-OutlookSignatures can now handly ini files with only one section. The Outlook file version query has been fixed, too. Closing this issue.

from set-outlooksignatures.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.