After creating MSI Installer for WPF app in Visual Studio 2017, EXE does nothing

后端 未结 2 1691
悲哀的现实
悲哀的现实 2020-12-12 07:27

I\'ve used the Setup Project in Visual Studio for Console apps with no problems, however, until now, I\'ve always ran any WPF apps I\'ve created in Visual Studio. This is my

2条回答
  •  萌比男神i
    2020-12-12 07:55

    I removed the scripts and hard coded them into the MainWindow.xaml.cs file like so:

    private static string checkAppsScript = @"$appList = @('*BingNews*','*BingWeather*','*OneNote*','*WindowsAlarms*', 
                                                               '*Recorder*', '*Maps*','*Camera*', '*Microsoft.People*',
                                                               '*xboxapp*', 'ZuneMusic*','*Messaging*', '*Builder*', 
                                                               '*BubbleWitch*', '*Minecraft*', '*Spotify*',
                                                               '*Empires*', '*StickyNotes*', '*Skype*', '*SolitaireCollection*')
    
    
                                                ForEach($app in $appList)
                                                {
                                                  Get-AppxPackage | Select Name | Where-Object {$_.Name -like $app}
                                                }";
    

    I removed the images and re-added them using "Add Existing Item." I had originally used "Add Item." I placed all images in a res folder (I had two folders, which was pointless). The executable now works.

提交回复
热议问题