Hello guys I hope you can help me with the following issue...
I'm using Wise Installation Studio 7.3.0.250.

I have file called ".xyz". This file has been saved by a third party application in the CommonAppDataFolder.
It is hidden and has the attrib system.
I want this file get deleted during install and uninstall by my application...

How can I make it visible, make the system attrib vanish and how can I delete it after all that by my msi application?

This must work under win2000 to win7.

Any ideas?

Thanks in advance

Cheers
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Can you try a custom action that uses attib -h command
place thsi custom action before removefiles std action and within contion REMOVE=ALL

cheers,
Emmy
Answered 07/29/2009 by: emmy12
Senior Yellow Belt

Please log in to comment
0
Could ya please provide me with a work-around? I mean how does the , I guess, cmd commandline look like?
Do I have to put it into the execute immediate or into the deferred?

cmd.exe/c ....

Thanks in advance
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
May be i am wrong but no need to make that file visible. I have done it without making it visible.

http://itninja.com/question/gnu,-freeware-and-shareware-programs-to-cloning9587&mpage=1&key=&#49660
Answered 07/29/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
Thanks,
can I modify this path?
strpath = strprogramfiles & "\.xyz" into "[CommonAppDataFolder].xyz" ???
Cause I never worked with such scripts before...

And if I can do this what kind of script is it? vbscript, wisescript, embedded code or something? sorry for asking anything like this.

Cheers
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
wait for some time, i will edit this script according to your requirement, and then i will post it.....by the way this is vbscript
Answered 07/29/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
Thank you very much, bro.

I hope it will work on Vista and Win 7, too.

Cheers
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
'this script will check the file exists, and then it will delete it.
Option Explicit
On Error Resume NExt
Dim Objshell
Dim Objfso
Dim strallusersfiles
Dim strpath
Dim strpath1
Dim strpath2
Dim objfolder


Set objshell = Createobject("Wscript.shell")
Set Objfso = Createobject("scripting.filesystemobject")
strallusersfiles = objshell.expandenvironmentstrings("%allusersprofile%")

strpath = strallusersfiles & "\Application Data\Suchikant.txt"

If objfso.fileexists (strpath) Then

objfso.deletefile (strpath)

End If
Answered 07/29/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
Thanks a lot. I will test it to the acid.

I will reply later on if it works or not...
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Sorry but it doesn't work at all. The file doesn't get deleted during install und uninstall sequence.

I don't know what do do now.

??????????????????????????????????????????????????????????????
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
on which operating system it is not working? and have you tried to trigger it manually? if manually it is working then, it should work
Answered 07/29/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
I was just testing it on xp sp3.

I was not testing it manually
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
test it manually 1st just by double clicking on it....and keep file at %allusersprofile%\application data\suchikant.txt
Answered 07/29/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
Hello McRip,

Just a piece of advice... Try using the many available standard actions using your Wise tool before using a Custom Action. Your problem is very easy to be fixed by using RemoveFile table...
Answered 07/29/2009 by: dj_xest
Fifth Degree Black Belt

Please log in to comment
0
I was just trying it but does't work.
VBScript is activated
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
yes.....it should get solved through removefile table as well......because i have put .gid file entries in removefile table, and it works. .gid files are hidden files
Answered 07/29/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
Thanks guys for your efforts here. I solved it by using the remove file table.

Thank you
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
I was testing a bit more and it is working. The reason why it didn't work before is pretty simple.
I'm testing on a German operating system.

My question now is:
The path variable for english operating systems is %ALLUSERSPROFILE%\Application Data
The path variable for german operating systems is %ALLUSERSPROFILE%\Anwendungsdaten

Is there a global path variable for solving this issue? Because it can not be true that it doesn't work on different operating systems with different languages.

There must be a resolution for it.

Any ideas???????????? Because I want to get it working. Please understand this, guys.

Thanks in advance
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Use the CommonAppDataFolder property instead of an environment variable. http://msdn.microsoft.com/en-us/library/aa367992%28VS.85%29.aspx
Answered 07/29/2009 by: VBScab
Red Belt

Please log in to comment
0
ORIGINAL: VBScab

Use the CommonAppDataFolder property instead of an environment variable. http://msdn.microsoft.com/en-us/library/aa367992%28VS.85%29.aspx


I knew that this point will be posted...

Thanks VBScab.
Do I have to use it in brackets or not in the embedded vb code?
[CommonAppDataFolder] or CommonAppDataFolder

Thanks in advance
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
All properties need to be referenced inside square brackets, yes.

How one accesses properties in embedded VBS depends on where the CA is sequenced.

In 'Execute Immediate', use Session.Property("the_name_of_the_property"). In 'Execute Deferred', scripts have access to only a very limited set of properties, one of which is 'CustomActionData'. Use of that special property is tricky to explain but I have a go here http://itninja.com/question/how-do-you-roll-out-new-machines?7008&mpage=1&key=customactiondata榃 and our good friend Owen posts a link to another explanation below my post.
Answered 07/29/2009 by: VBScab
Red Belt

Please log in to comment
0
OK, guys, if you are interested, here is my modified code and it works great:

'this script will check the file exists, and then it will delete it.
Option Explicit
On Error Resume next
Const alluser = &H23&
Dim Objshell
Dim oFSO
Dim filetokill
Dim oAlluser
Dim oAlluserItem

Set oFSO = Createobject("scripting.filesystemobject")
Set objShell = CreateObject("Shell.Application")
Set oAlluser = objShell.Namespace(alluser)
Set oAlluserItem = oAlluser.Self

filetokill = oAlluserItem.Path & "\something.txt"

If oFSO.fileexists (filetokill) Then
oFSO.deletefile (filetokill)
End If
on error goto 0


Cheers
Answered 07/29/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Your script (not uncommonly) assumes that everything is going to work. A basic addition would be:
If oFSO.fileexists (filetokill) Then
oFSO.deletefile (filetokill)
If oFSO.fileexists (filetokill) Then
'// Tell the user by your chosen mechanism (e.g. MsgBox or Event Log, preferably both) that the delete failed
End If
End If
on error goto 0
Answered 07/30/2009 by: VBScab
Red Belt

Please log in to comment
0
Why do we use on error go to 0?
Answered 07/30/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
GoTo 0
Disables enabled error handler in the current procedure and resets it to Nothing.


http://msdn.microsoft.com/en-us/library/5hsw66as.aspx

Cheers
Answered 07/30/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
is it same like on error resume next?
Answered 07/30/2009 by: suchi.jigar
Purple Belt

Please log in to comment
0
Resume Next
Specifies that when a run-time error occurs, control goes to the statement immediately following the statement where the error occurred, and execution continues from that point. Use this form rather than On Error GoTo when accessing objects.

Cheers
Answered 07/30/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
The script is a bad example on its use, since it's used here to stop any errors interrupting the program's flow but without any handling of any error which might occur. Thus, if for some reason the Shell object failed to be created, the script would carry on regardless. Of course, it's unlikely that that would happen but, as I'm forever trying to tell people, you should ALWAYS assume that the worst WILL happen. So, taking the Shell object creation as an example, it really ought to look like this:Set objshell = Createobject("Wscript.shell")
If Not IsObject(objshell) Then
'// Tell the user that their machine is seriously broken
WScript.Quit(False)
End If
...and so on.When you've written a few scripts which include object creation, you'll quickly add a function template called, say, ObjectCreation, to which you can add all the error-handling, meaning that the code which does the work isn't cluttered with endless 'If Not IsObject' constructs.
Answered 07/30/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity