Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / win32 / customactions / quickstarter / remove_quickstart_link.cxx
blob1d1b3c61d67a7f72fb0cc14a7d60192dac38c2cf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifdef _MSC_VER
30 #pragma warning(push, 1) /* disable warnings within system headers */
31 #pragma warning(disable: 4917)
32 #endif
33 #define WIN32_LEAN_AND_MEAN
34 #include <windows.h>
35 #include <shlobj.h>
36 #include <msiquery.h>
37 #ifdef _MSC_VER
38 #pragma warning(pop)
39 #endif
41 #include <string>
42 #include "quickstarter.hxx"
45 extern "C" UINT __stdcall RemoveQuickstarterLink( MSIHANDLE hMSI )
47 CHAR szStartupPath[MAX_PATH];
49 if ( SHGetSpecialFolderPathA( NULL, szStartupPath, CSIDL_STARTUP, FALSE ) )
51 std::string sQuickstartLinkPath = szStartupPath;
53 sQuickstartLinkPath += "\\";
54 sQuickstartLinkPath += GetQuickstarterLinkName( hMSI );
55 sQuickstartLinkPath += ".lnk";
57 DeleteFileA( sQuickstartLinkPath.c_str() );
60 return ERROR_SUCCESS;
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */