Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-10-2006, 07:41 AM
Junior Member
 
Join Date: Sep 2006
Posts: 10
Default The problem of uninstalling shortcut in startup

In the "BeforeUninst" script, you just need to remove the shortcut as follows:



I am using the following code at the uninstall script trying to removing the shortcut I have installed in the startup menu, but somehow, the shortcut icon in the startup menu still hasn't been removed. If anybody knows how to solve this problem in the SWFkit, please reply this thread. Thank you very much.

Code:

// get the startup folder
var startup = Shell.getSpecialFolder("startup all");

// remove the shortcut
var f = new File(startup + "\\My Demo" + ".lnk");
f.remove();





Reply With Quote
  #2 (permalink)  
Old 09-10-2006, 02:24 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:The problem of uninstalling shortcut in startup

Really strange, please try the attached sample out. It can work on our computers.
Reply With Quote
  #3 (permalink)  
Old 09-10-2006, 09:14 PM
Junior Member
 
Join Date: Sep 2006
Posts: 10
Default Re:The problem of uninstalling shortcut in startup

Hi, Thanks for the reply.

I have tried the file you attached, but it works out the same with mine. I have tried in 2 different computers. When I uninstall the program, the icon in the "startup" folder is still there.

Do you see the shortcut in the "startup" menu disappear when you tested in your computer?

I am not sure if there is anything to do with different language Windows. We are testing this program in Chinese Windows, would that be the problem? Is that because the startup folder is different?? But it works fine while installing, the problem only happens when "uninstall".

The startup directory I found in my computer is



Is there anything need to be modified regarding using the different language windows?
Reply With Quote
  #4 (permalink)  
Old 09-10-2006, 09:54 PM
Junior Member
 
Join Date: May 2004
Posts: 9
Default Re:The problem of uninstalling shortcut in startup

..this is old bug..
..some functions not working in AfterInstall and BeforeUninst scripts..

..solution:
..call your script from BeforeUninst as another script..


//BeforeUninst Script
invoke("Uninstall");
-------
//Uninstall Script
......your script for remove shortcut.....
Reply With Quote
  #5 (permalink)  
Old 09-11-2006, 12:34 AM
Junior Member
 
Join Date: Sep 2006
Posts: 10
Default Re:The problem of uninstalling shortcut in startup

Hi IksY,

Thanks for replying the thread..
I have tried your new suggestion...
But it still doesn't remove the shortcut from the startup...
Have you ever tried the uninstallation successfully using swkfit before?
And did you see the uninstallation working in the startup group?
If you do, please point out any special code for that?

I also wish the SWFKIT has any solution for this situation..
or anyone has ever done the uninstallation successfully...
Reply With Quote
  #6 (permalink)  
Old 09-11-2006, 10:00 AM
Junior Member
 
Join Date: May 2004
Posts: 9
Default Re:The problem of uninstalling shortcut in startup

..hi laxi..
..do several tests and post results to this thread..

1)
..is the shortcut removable via explorer ??

2)
..log yourself to system as administrator..install / uninstall your app..
..was shortcut removed ??

3)
..create simple test app (no installer) for remove the shortcut..run it..
..was shortcut removed ??

4)
..in your app - BeforeUninst script:
..write shortcut path as full-path-string.."c:\\doc...........my demo.lnk"..
..compile, install, uninstall..
..was shortcut removed ??

5)
..are working other functions (copy, move) and is possible rename the shortcut via BeforeUninst script ?? ..test it..

6)
..open explorer..create in startup folder shortcut "test.lnk" and text file "test.txt"..
..modify your BeforeUninst script for remove "test.lnk" and "test.txt"..
..compile, install, uninstall..
..was removed "test.lnk" ??
..was removed "test.txt" ??

7)
..modify your BeforeUninst script:

Application.traceToFile("<your temp dir>\\test.txt");
var dir = Shell.getSpecialFolder("startup all");
var lnk = dir + "\\My Demo.lnk";
trace("startup dir: " + dir);
trace("shortcut: " + lnk);
trace("shortcut exists: " + File.exists(lnk));
var file = new File(lnk);
if (file == undefined) {
trace("File open: Failed");
} else {
trace("File open: OK");
if (file.remove()) {
trace("File remove: OK");
} else {
trace("File remove: Failed");
}
}

..after install / uninstall open "test.txt" in temp folder..
..copy and paste content to this thread..
Reply With Quote
  #7 (permalink)  
Old 09-11-2006, 10:16 AM
Junior Member
 
Join Date: May 2004
Posts: 9
Default Re:The problem of uninstalling shortcut in startup

8)
..is possible remove any shortcut from other dirs (e.g. temp dir) via BeforeUninst script ?? ..test it..
Reply With Quote
  #8 (permalink)  
Old 09-11-2006, 11:47 PM
Junior Member
 
Join Date: Sep 2006
Posts: 10
Default Re:The problem of uninstalling shortcut in startup

Hi IksY,

Thanks for pointing out couple ways to test out the problem.

Base on your suggestion..

I have tried out couple things and found something interesting..

1. I put a file in a testing folder and use the uninstall to remove the file. It works well with the original code when I specify the file location.

2. I put a file in the "startup" folder, and try to use the same way to remove the file. It didn't work.

Firstly, let me discribe a little bit about my computer setting...
In my windows, there are 2 Windows OS installed in my computer.

The original OS came with the computer was an Japanese version Windows XP Home. So, it has used the default windows folder name "WINDOWS" referring the default OS.

And then I installed a second OS in this computer which is a Chinese Windows XP professional. Which uses the folder name "WINDOWSC" And I made these 2 OS listed in the boot menu.


I have tested this APP in the Japanese Windows, which has been referred as "WINDOWS", and the uninstallation works well to remove the lnk file in the startup folder in that Japanese Windows.....

But when I was using the Chinese windows, which has been referred as "WINDOWSC" folder. The uninstallation startup lnk removal becomes a problem...

No matter the full path or using
var f = new File(startup + "\\InsDemo" + ".lnk");
I can never make the lnk file removed successfully.
I have already tried to put a txt file in the same directory,
still seems nothing can be touched under that folder.

So base on these testing result...
I think the problem might be as follow..

1. I have tested couple different combination of different kind of direct folder directory, and I found in other language (Chinese language) combines some special character as the file names... The removal is not stable all the time.

I think maybe there is some bug while the SWFKIT parsing the string.. cuz while compiling.. sometimes, the warning message shows up as
warning: line 12: unknown escape sequence \?

And when that warning happens.. the access of removing that file in that particular folder would fail...


2. While using
(startup + "\\InsDemo" + ".lnk");

Maybe because the Chinese language OS startup menu wasn't using the "WINDOWS" default file name.. but using "WINDOWSC" as a second OS.

so the directory it gets caused some problem while processing the data of the directory...


Maybe that's problem or maybe not..

but the testing results
While I put a file in

C:\Documents and Settings\All Users.WINDOWSC

and point to the full path
It would be removed successfully

------------------------------
And when I put a file in

and point to the full path
The file removal function started to fail...


There must be something to do with language or second OS affecting the SWFKIT compiling..
Reply With Quote
  #9 (permalink)  
Old 09-12-2006, 01:41 AM
Junior Member
 
Join Date: Sep 2006
Posts: 10
Default Re:The problem of uninstalling shortcut in startup

I just tested in some computer with only one Chinese Windows system as default OS.

The startup removal fails either...
Reply With Quote
  #10 (permalink)  
Old 09-12-2006, 01:07 PM
Junior Member
 
Join Date: Sep 2006
Posts: 10
Default Re:The problem of uninstalling shortcut in startup

I tested the same original code and tested the install and uninstall process in English Windows, Japanese windows and chinese windows in 6 different computer...

I found the startup removal works in Japanese windows and Egnlish ones...

And in Traditional Chinese Windows, the result is not stable, seems there is some bug while compiling the string of Chinese startup path in SWKFIT.

Hopefully, when SWFKIT team find this thread, they would be able to fix something at the SWFKIT software...regarding the text parsing problem in different language code set.

Thanks for the help~~!
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:53 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.