WinGet-Wrapper icon indicating copy to clipboard operation
WinGet-Wrapper copied to clipboard

PostInstallScript path

Open LarsBjerring opened this issue 10 months ago • 1 comments

Thank you for writing the application. It' just what I need. However, I have few smaller issues.

When you put in a path for a PostInstallationScript Ex. "C:\myscripts\myapplication\script1.ps1". Then the script is copied to the package folder, but the install command will use the full path "-Postscript 'C:\myscripts\myapplication\script1.ps1'. I would expect the command to only have the script name as it's included in the package. I think this could be fixed by something like this:

#existing
$InstallCommandLine += " -Prescript '$($row.PreScriptInstall)'"

#new
$scriptname = split-path $row.PreScriptInstall -leaf
$InstallCommandLine += " -Prescript '$scriptname'"

-- The second problem I had was, that I need to copy a config file to the computer after the installation have completed. I would like to have the config file included in the package and not use an external file store. Would it be possible to have an option to specify files to include in the package? I know I could create the package manual.

LarsBjerring avatar Mar 27 '24 10:03 LarsBjerring

Hi Lars, Ah yes, this may be an issue. I haven't used the pre and post script a lot, only implemented as it thought it would be useful. I will try to implement the solution once I get a chance.

About your second issue, That could be an idea to allow adding files into the package. The easiest approach without any changes to the import scripts and GUI is that you simply add in your file into \Packages folder which i generated with the import, then manually run IntuneWinAppUtil.exe to generate the intunewin file.

It could be useful in the script or GUI, but I do think it's important to keep the solution simple and understandable,. Already I do feel there is a bit too many options and switches which quickly gets confusing 😁

Thanks for reaching out

SorenLundt avatar Apr 04 '24 12:04 SorenLundt