psmsi icon indicating copy to clipboard operation
psmsi copied to clipboard

Multiple issues / feature requests

Open Skatterbrainz opened this issue 2 years ago • 2 comments

Overall - I (LOVE) this module and it does make a solid installer package. Thank you!

Maybe it's just my ignorance, but the -Platform option doesn't have any effect on the target path when I use ProgramFilesFolder. It always installs to \Program Files (x86). Is there a way to install to \Program Files or even a custom location?

On Windows 11, the -NewInstallerShortcut doesn't seem to have any effect after installation. No shortcut appears on Start, Taskbar or Desktop. Maybe I'm misunderstanding that?

The documentation markdown shows -Product, but the function expects -ProductId or -ProductName (ambiguous).

Skatterbrainz avatar Nov 27 '22 01:11 Skatterbrainz

Glad you're digging it!

Maybe it's just my ignorance, but the -Platform option doesn't have any effect on the target path when I use ProgramFilesFolder. It always installs to \Program Files (x86). Is there a way to install to \Program Files or even a custom location?

Not really sure why this is the case but seems like it's a bug.

On Windows 11, the -NewInstallerShortcut doesn't seem to have any effect after installation. No shortcut appears on Start, Taskbar or Desktop. Maybe I'm misunderstanding that?

Interesting. I haven't actually done this in a while so maybe it broke with Win11.

The documentation markdown shows -Product, but the function expects -ProductId or -ProductName (ambiguous).

Just fixed this.

adamdriscoll avatar Nov 29 '22 17:11 adamdriscoll

Thank you for the fast reply! I also think it might be a misunderstanding on my part with where to "nest" the New-InstallerDirectory items and New-InstallerShortcut within the New-Installer -Content script block. I may have things in the wrong place? Here's an example...

`[CmdletBinding()] param ( [parameter()][string]$ProductName = "My Application", [parameter()][string]$ShortName = "MyApp", [parameter()][string]$Version = "1.0.0", [parameter()][guid]$UpgradeCode = '44de2fbc-3027-4f46-8b6b-ef9fddb328ad', [parameter()][string]$Publisher = "Dave", [parameter()][string]$SourcePath = "d:\labsources\pkg\source", [parameter()][string]$IconPath = "D:\sources\pslabs.ico", [parameter()][string]$OutputFolder = "d:\labsources\pkg\output", [parameter()][string]$AboutURL = "https://github.com/skatterbrainz/blahblah" )

Import-Module psmsi

New-Installer -ProductName $ProductName -Manufacturer $Publisher -UpgradeCode $UpgradeCode -Content { New-InstallerDirectory -PredefinedDirectory "LocalAppDataFolder" -Content { New-InstallerDirectory -DirectoryName $ShortName -Id "main" -Content { Get-ChildItem -Path $SourcePath -Filter "." | Where {$.Attributes -ne 'Directory'} | Foreach { New-InstallerFile -Source $.FullName -id $($.BaseName -replace '-','') } } New-InstallerDirectory -PredefinedDirectory "DesktopFolder" -Content { New-InstallerShortcut -Name $ShortName -FileId "README" -IconPath $IconPath } } } -OutputDirectory $OutputFolder -Version $Version -Platform x64 -AddRemoveProgramsIcon $IconPath -AboutLink $AboutURL `

Skatterbrainz avatar Nov 30 '22 19:11 Skatterbrainz