Close

WIX – Embed powershell into an MSI file

You can embed a single powershell command into an wxs file like this:

 


    
        

            
	        
		    NOT Installed AND NOT PATCH
		
	    
    

 
Note, if DIR_v1.0 path contains spaces, e.g. "program files", then you need to use "&qoute;"
 

Here's another example, but this time using installutil.exe as an example:



		
			
				NOT Installed AND NOT PATCH
			
		


		

		
			
				Installed
			
		

Any folder reference's e.g. "DIR_v2" within square-brackets automatically get's expanded.

https://www.google.co.uk/search?hl=en-GB&ie=UTF-8&source=android-browser&q=embed+powershell+wix&gfe_rd=cr&ei=JHj_U7_nNPHH8geBxoHYBQ&gws_rd=ssl#hl=en-GB&q=embed+powershell+wix

http://stackoverflow.com/questions/2313545/execute-command-line-in-wix-script

http://stackoverflow.com/questions/15472793/custom-action-on-install-only