windows installer - Using Visual Studio to build a .msi file that has a custom action to run a .bat file -
i need use visual studio build .msi file execute commands have in .bat custom action. know can accomplish going .msi , altering tables , i've gotten work, it's short fix , need working. in particular want execute custom action on uninstall.
first thing tried writing .exe called .bat. works stand-alone, whenever put files in file system , have custom action run .exe doesn't work. knows why..
the other thing did have custom action use cmd.exe .bat argument. error during uninstall , event viewer narrows down cmd.exe using /c "[targetdir]batfile.bat https://stackoverflow.com/a/6286046/1427105.
any thoughts can me out?
what this?
protected override void onbeforeuninstall(idictionary savedstate) { base.onbeforeuninstall(savedstate); string assemblypath = context.parameters["assemblypath"]; string parentdirectory = directory.getparent(assemblypath).fullname; string batch = path.combine(parentdirectory, "batfile.bat"); process p = process.start(batch); while (!p.hasexited) thread.sleep(1000); }
Comments
Post a Comment