- NSIS Discussion
- Cannot delete folder/file with non-EN character
Archive: Cannot delete folder/file with non-EN character
Clam
5th September 2005 19:03 UTC
Cannot delete folder/file with non-EN character
In my uninstaller I want to remove the shortcuts created during install.
The shortcuts reside in the Start Menu, and contain a Japanese colon "***65306;"
The reason for this, is that my installer patches the original program, and then replaces the original programs uninstaller..
Therefore needs to remove the original shortcut created with the original installer.
The program group in the Start Menu also contains the Japanese colon "***65306;".
For example:
$SMPROGRAMS\Program***65306;Folder\Program***65306;Shortcut.lnk
I hope that makes some sense. For some reason "Delete" and "RMDir" will not remove files/folders with that character in it.
Thank you very much for your time in reading this problem : )
Clam
5th September 2005 20:43 UTC
More info
Here's some more info...
It seems I can't create the icon folder if it doesn't already exist:
Error creating shortcut: C:\Documents and Settings\Administrator\Start Menu\Programs\Program***65306;Group\Uninstall.lnk
But when the original program creates the folder, I can insert my Uninstaller link in there...
It seems NSIS doesn't like to write files/folders with non-EN characters??
Clam
6th September 2005 10:56 UTC
I would hate to call a batch script just to delete/create these files :/
How does NSIS handle other 'strange' characters in filenames?
onad
6th September 2005 12:38 UTC
The Japanese : does not have te same ASC value as the Regular :, use the ASC value instead of typing a ":" on the keboard.
e.g. "xyz"#240"andtherest" where 240 is just an example. I do not know the exact value for the Japanese : sign.
Success
Clam
6th September 2005 13:40 UTC
Originally posted by onad
The Japanese : does not have te same ASC value as the Regular :, use the ASC value instead of typing a ":" on the keboard.
e.g. "xyz"#240"andtherest" where 240 is just an example. I do not know the exact value for the Japanese : sign.
Success
Are you saying to enter "#65306" into the script? do I need to escape it with anything? Like: $\#65306 or something?
Or will just:
Delete "$SMPROGRAMS\Program#65306Group"
Work?
I will try it, but somehow I don't think it'll work.
When I insert ":" into my script, the Compiler processes it fine, because if you check the log file I attached, it's using the correct colon, but it can't do anything with it for some reason.
Thanks for your advice, I'll play with it now, and hope for the best ;(
Clam
6th September 2005 13:48 UTC
I tried using the #65306 but I don't think I used it correctly.
Error creating shortcut: C:\Documents and Settings\Administrator\Start Menu\Programs\Program#65306Group\Uninstall.lnk
CreateShortCut "$SMPROGRAMS\Program#65306Group\Uninstall.lnk" "$INSTDIR\uninst.exe"
Normally it would be something like this:
CreateShortCut "$SMPROGRAMS\Program***65306;Group\Uninstall.lnk" "$INSTDIR\uninst.exe"
onad
6th September 2005 14:30 UTC
You have to push the whole string into a variable first. Then use the variable.
Clam
6th September 2005 14:42 UTC
Hmm, I'm not to sure how to go about that, (I'm a bit of a novice when it comes to push/pop)
The only way I can confidantly add a string to a varible is with StrCpy :(
Maybe if you could spare the time, a quick example could put me in the right direction?
Thank you very much for the help thus far.
Comm@nder21
6th September 2005 15:10 UTC
The only way I can confidantly add a string to a varible is with StrCpy
it IS the only way, use it.
well, ok, actually there's another way:
Push "something"
Pop $SOMETHING
now $SOMETHING contains "something" (without "")