I have a sandboxed solution with these items:
- A module
- Elements.xml (ElementManifest)
- HelloWorld.txt
- Package
- MyPackage-1.0.1
- 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.
Update
So far I have come by two different ways to do this, the first is a hack and the other is a hack.
Hack 1
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();
Hack 2
It does seem that Elements.xml is updated, so it is possible to inline the whole script into this file. This could be added to Elements.xml with a build script or similar, as one would probably not want to write JavaScript or CSS directly in Elements.xml.