I have a sandboxed solution with these items:
- A module
- Elements.xml (ElementManifest)
- A feature
- Scoped for site
In addition the solution is set to Include Assembly = False.
I want this solution to be 'upgradable'.
When end user upload a new version of my WSP they should be able to click 'Upgrade' and the files are renewed, and the Elements.xml updated.
If I change package name (For example from MyPackage-1.0.1 to MyPackage-1.0.2) the solution is upgradable, but files are not changed.
So far I have come by two different ways to do this, the first is a hack and the other is a hack.
Use Client Object Model to delete the files. I do not have a good example of how to trigger the script (could be done from listening to the "Upgrade" button), but deleting the files is quite easy:
var ctx = new SP.ClientContext(); ctx.get_web().getFileByServerRelativeUrl('/eirikb/js/myscript.js').deleteObject(); ctx.executeQueryAsync();