Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple issues / feature requests #2

Open
Skatterbrainz opened this issue Nov 27, 2022 · 2 comments
Open

Multiple issues / feature requests #2

Skatterbrainz opened this issue Nov 27, 2022 · 2 comments

Comments

@Skatterbrainz
Copy link

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).

@adamdriscoll
Copy link
Member

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.

@Skatterbrainz
Copy link
Author

Skatterbrainz commented Nov 30, 2022

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
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants